Hey guys,
I am retrieving a variable that contains a £ sign from another page. I want to remove this and I have tried using str_replace but I am left with the following:
�100.
$amount = str_replace('£', '', $amount);
Any ideas?
Hey guys,
I am retrieving a variable that contains a £ sign from another page. I want to remove this and I have tried using str_replace but I am left with the following:
�100.
$amount = str_replace('£', '', $amount);
Any ideas?
If you are guaranteed that the string will always be of that form, chop off the first character.
Alternately, convert it to HTML entities (try htmlentities()
) and then do a str_replace()
.
Make sure the character set you're using in your HTML page is the same as the character set your database table is using (and storing data). This usually happens when you have differing character sets.
Also try encoding pound symbols as its HTML entity equivalent (£
) before saving them to the database.