note 92777 deleted from function.utf8-decode by cmb
| From: | cmb@php.net | Date: | Sun, 11 Dec 2016 11:27:57 +0000 |
| Subject: | note 92777 deleted from function.utf8-decode by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-208520@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
In addition to Blackbit's note below, here's my shot at converting UTF-8 strings to HTML
entities.
<?php $encoded = preg_replace('/([\200-\277])/e',
"'&#'.(ord('\\1')).';'", $utf8str); ?>
This code converts one byte UTF-8 to HTML entities while below you'll find conversions for two
byte and three byte UTF-8.