note 37730 added to function.eregi-replace

From: Date: Mon, 24 Nov 2003 23:28:11 +0000
Subject: note 37730 added to function.eregi-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-60922@lists.php.net to get a copy of this message
This function replace < and > symbols between <code> and </code> tags by html code for lower than (&lt;) and greather than (&gt;) elements. function retourne_format_code($texte) { $tablo=split("<code>",$texte); $texte=""; $texte.=$tablo[0]; foreach($tablo as $cle=>$valeur) { if(eregi("</code>",$valeur)) { $tablo1=split("</code>",$valeur); $tablo1[0]=eregi_replace("<","&lt;",$tablo1[0]); $tablo1[0]=eregi_replace(">","&gt;",$tablo1[0]); foreach($tablo1 as $cle1=>$valeur1) { if($cle1==0) $valeur1="<code>".$valeur1."</code>"; $texte.=$valeur1; } } } return $texte; } ---- Manual Page -- http://www.php.net/manual/en/function.eregi-replace.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+37730 Delete -- http://master.php.net/manage/user-notes.php?action=delete+37730&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+37730&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#60922) next »