note 77910 added to function.chr

From: Date: Wed, 19 Sep 2007 13:02:25 +0000
Subject: note 77910 added to function.chr
Groups: php.notes 
Request: Send a blank email to php-notes+get-130596@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: o caracter 's' é convetido para &#115 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/77910 Del: integrated -- https://master.php.net/note/delete/77910/integrated Del: useless -- https://master.php.net/note/delete/77910/useless Del: bad code -- https://master.php.net/note/delete/77910/bad+code Del: spam -- https://master.php.net/note/delete/77910/spam Del: non-english -- https://master.php.net/note/delete/77910/non-english Del: in docs -- https://master.php.net/note/delete/77910/in+docs Del: other reasons-- https://master.php.net/note/delete/77910 Reject -- https://master.php.net/note/reject/77910 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#130596) next »