Fix Encoding on Variable
Posted: Tue Aug 25, 2009 6:56 pm
Hello everyone,
I'm currently pulling some data from a SQL row that is used as the backend for a forum. I am placing this into a variable called lets say $variable1.
Now sometimes the post on the forums are different, for example on some posts people put in (if they copied and pasted) you will get this type of quotation mark: “ as opposed to ". Now this is only a problem when I display this row on a page because it comes out all messed up like this “I looked into the rear view mirror and I saw it leap across my trunk.â€
Any idea how I can fix this? I guess I have to run the string through a function to change the encoding but not sure where to start. Any help would be appreciated.
Regards,
TNT
I'm currently pulling some data from a SQL row that is used as the backend for a forum. I am placing this into a variable called lets say $variable1.
Now sometimes the post on the forums are different, for example on some posts people put in (if they copied and pasted) you will get this type of quotation mark: “ as opposed to ". Now this is only a problem when I display this row on a page because it comes out all messed up like this “I looked into the rear view mirror and I saw it leap across my trunk.â€
Any idea how I can fix this? I guess I have to run the string through a function to change the encoding but not sure where to start. Any help would be appreciated.
Regards,
TNT