php - Convert special characters to HTML character codes -


i'm developing cms customer , needs edit stuff , use special characters such ç , ®. however, don't want him have enter character codes ®. knows way automatically convert characters using php?

you can use htmlentities() that.

php -r 'echo htmlentities("®ç", ent_compat, "utf-8"), "\n";' ®ç 

to turn entities readable text, use html_entity_decode():

php -r 'echo html_entity_decode("®ç", ent_compat, "utf-8"), "\n";' ®ç 

if you're not using unicode, omit charset name or give correct charset.


Comments

Popular posts from this blog

drupal - using views argument in the view tpl.php file -

php - Posting PHPBB Forum Thread/Post info in a website -

php - Add a blog by sending a mail to a certain emailadress -