note 16136 modified in function.htmlentities by zak

From: Date: Wed, 17 Oct 2001 16:53:21 +0000
Subject: note 16136 modified in function.htmlentities by zak
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-19053@lists.php.net to get a copy of this message
For everybody would like to convert { to the original char: function numeral2original($in) { while(ereg("&#([0-9]{0,4});",$in,$x)) { $out .= substr($in,0,strpos($in,$x[0])).chr($x[1]); $in = substr($in,strpos($in,$x[0])+strlen($x[0])); } return $out.$in; } Have phun, just mail me for comments... [Editor's Note: Or see get_html_translation_table() and str_replace()/strtr() --zak@php.net] --was-- For everybody would like to convert { to the original char: function numeral2original($in) { while(ereg("&#([0-9]{0,4});",$in,$x)) { $out .= substr($in,0,strpos($in,$x[0])).chr($x[1]); $in = substr($in,strpos($in,$x[0])+strlen($x[0])); } return $out.$in; } Have phun, just mail me for comments... http://www.php.net/manual/en/function.htmlentities.php

« previous php.notes (#19053) next »