Unicode Characters While Data Processing

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kkonline
Forum Contributor
Posts: 251
Joined: Thu Aug 16, 2007 12:54 am

Unicode Characters While Data Processing

Post by kkonline »

Hello All,
While working with some data I get characters like \x2F,\x26 etc

http:\x2F\x2Fstocks.us.reuters.com\x2Fstocks\x2Fratios.asp?rpc=66\x26symbol

Could you please suggest how can I convert these characters to regular format like
\x2F to /
\x26 to &

Regards,
Krishna Khanna
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Unicode Characters While Data Processing

Post by Christopher »

To replace them in strings, use functions like iconv() or htmlentities(), or manually with str_replace() or preg_replace(). Many frameworks have a class that does this, you could use one of those.
(#10850)
Post Reply