note 61446 deleted from function.preg-replace by colder
| From: | colder@php.net | Date: | Mon, 18 Jun 2007 19:57:45 +0000 |
| Subject: | note 61446 deleted from function.preg-replace by colder | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-127682@lists.php.net to get a copy of this message | ||
Note Submitter:
----
fairly useful script to replace normal html entities with ordinal-value entities. Useful for
writing to xml documents where entities aren't defined.
<?php
$p='#(\&[\w]+;)#e';
$r="'&#'.ord(html_entity_decode('$1')).';'";
$text=preg_replace($p,$r,$_POST['data']);
?>