-
str_replace ° to °
Now I had this working a few weeks ago but something must have changed and now it no longer works.
Here's my code, if someone could help me out and spot any errors or give advice, that would be brilliant :)
PHP Code:
$pos1[1] = str_replace("°","°",$pos1[1]);
echo $pos1[1];
-
It works fine for me, no problems when I add this to the beginning:
Code:
$pos1[1]="Hey, it's 7°C";
You might want to consider using the htmlentities() function to replace all special characters with their HTML equivalents, eg.
Code:
$pos1[1]=htmlentities($pos1[1]);
-
Right click > View source.
-
Thanks for that Apolva, don't know why I didn't just do that in the first place :(
Working now anyway, now to convert the degrees minutes seconds into decimals.. fun :)
@Jewish Bear, heh heh.