How to convert & or any other encoded char using [php] to it's respective char? -
i need output text file using php, although of text has & , ½ cannot ones because text block large. there simple way take string containing these sorts of encodings , convert them respective chars?
example
$str = "it rained 2& frac12 ; inches on friday. (ignore spaces between & , ;)
when written file text read:
it rained 2½ inches on friday.
html_entity_decode()
should need!
an example of implementation returning decoded string be;
$str = html_entity_decode($str); //decoded string
Comments
Post a Comment