Jump to content

how to relplace � in a string ?


mikhak

Recommended Posts

how to relplace �  in a string ?

 

i tested this code but not working .

 $mycode = str_replace('�','AB',$mycode);

i want replace � with a word example AB

 

plaese help me .

 

thank you.

Edited by mikhak
Link to comment
Share on other sites

That's not (supposed to be) a problem that you simply find-and-replace your way around. It's being inserted by something, odds are your browser, because you've given it characters to display that aren't valid for the character set you told it to use.

 

Where are you seeing that and what code and/or database do you have behind the scenes powering it?

Edited by requinix
Link to comment
Share on other sites

That's not (supposed to be) a problem that you simply find-and-replace your way around. It's being inserted by something, odds are your browser, because you've given it characters to display that aren't valid for the character set you told it to use.

 

Where are you seeing that and what code and/or database do you have behind the scenes powering it?

 

yes exactly i want to set char-set uft-8 for a string but display a glyph like � in the decoded string . i can't solve this probleme i trying all of methods but not solved.

 

for example my string :

 

$string = 'چي موقعي ميتوانيم برای خيار گلخانه از کود برگ جست است٠اده کنيم';

 

$decoded = mb_convert_encoding ($string, 'windows-1252', 'UTF-8');

 

decoded string in Persian language :

 

چي موقعي ميتوانيم برای خيار گلخانه از کود برگ جست است� اده کنيم

 

i think for solving this problem i can't use replace of � a i liked word .

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.