note 57199 deleted from function.htmlentities by mazzanet

From: Date: Mon, 03 Oct 2005 08:47:10 +0000
Subject: note 57199 deleted from function.htmlentities by mazzanet
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-96236@lists.php.net to get a copy of this message
Note Submitter: explosion at explosiondigital dot com ---- # Nice job with the xmlentities, really cool. # But just a little thing was missing, the unxmlentities # functions. Then, there is it! /** * Return the original text changed by xmlentities function * No string validade checked * @author Thiago Mata * @date 2005-09-27 * @version 1.0 * @param a xml string to be converted * @return a string with special chars */ function unxmlentities($xmlString) { $pos = strpos($xmlString,"&"); while ($pos !== false) { $before = substr($xmlString,0,$pos); $middle = substr($xmlString,$pos+2,3); $after = substr($xmlString,$pos+6); $middle = chr(($middle)); $xmlString = $before.$middle.$after; $pos = strpos($xmlString,"&"); } return $xmlString; } print unxmlentities("Thíägô Hènriqüê Rãmos da Màtá"); # out "Thíägô Hènriqüê Rãmos da Màtá"

« previous php.notes (#96236) next »