note 77909 added to function.chr

From: Date: Wed, 19 Sep 2007 13:01:40 +0000
Subject: note 77909 added to function.chr
Groups: php.notes 
Request: Send a blank email to php-notes+get-130595@lists.php.net to get a copy of this message
####################################### função que converte caracteres asc de html em caracter normal usando chr() e preg_replace() ex de conversão: &#115 é convetido para o caracter 's' function convert_ASC_entities ($str){ $tasc=array(); $tch=array(); for($i=33;$i<=256;$i++){ $tasc[$i-33]="/&#".$i."/"; $tch[$i-33]=chr($i); } return preg_replace($tasc, $tch, $str); } ######################################### função que converte caracter normal em caracteres asc de html usando chr() e preg_replace() ex de conversão: &#115 é convetido para o caracter 's' function unconvert_ASC_entities ($str){ $tasc=array(); $tch=array(); for($i=33;$i<=256;$i++){ $tasc[$i-33]="/&#".$i."/"; $tch[$i-33]=chr($i); } return preg_replace($tch,$tasc, $str); } ######################################### ---- Server IP: 69.147.83.197 Probable Submitter: 189.6.213.105 ---- Manual Page -- http://www.php.net/manual/en/function.chr.php Edit -- https://master.php.net/note/edit/77909 Del: integrated -- https://master.php.net/note/delete/77909/integrated Del: useless -- https://master.php.net/note/delete/77909/useless Del: bad code -- https://master.php.net/note/delete/77909/bad+code Del: spam -- https://master.php.net/note/delete/77909/spam Del: non-english -- https://master.php.net/note/delete/77909/non-english Del: in docs -- https://master.php.net/note/delete/77909/in+docs Del: other reasons-- https://master.php.net/note/delete/77909 Reject -- https://master.php.net/note/reject/77909 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#130595) next »