cvs: php-gtk-web /include shared-manual.inc

From: Date: Sat, 01 Sep 2001 18:56:56 +0000
Subject: cvs: php-gtk-web /include shared-manual.inc
Groups: php.gtk.webmaster 
Request: Send a blank email to php-gtk-webmaster+get-23@lists.php.net to get a copy of this message
jmoore Sat Sep 1 14:56:56 2001 EDT Modified files: /php-gtk-web/include shared-manual.inc Log: - Add the dehtmlspecialchars function that allows us to hightlight_string the code in exmaples using a very big hack. # The reason for this is that the XSLT spec doesnt seem to # allow the escaping of special chars so I have done the following # Turn output buffering on # output example code # get contents of output buffer # destroy output buffer # Turn &gt; et all back into their respective charecters # hightlight & output the contents of the output buffer Index: php-gtk-web/include/shared-manual.inc diff -u php-gtk-web/include/shared-manual.inc:1.44 php-gtk-web/include/shared-manual.inc:1.45 --- php-gtk-web/include/shared-manual.inc:1.44 Sat Aug 11 09:42:34 2001 +++ php-gtk-web/include/shared-manual.inc Sat Sep 1 14:56:56 2001 @@ -430,3 +430,14 @@ } +function dehtmlspecialchars($str) +{ + + $str = preg_replace("%&gt;%",">",$str); + $str = preg_replace("%&lt;%","<",$str); + $str = preg_replace("%&quot;%","\"",$str); + $str = preg_replace("%&amp;%","&",$str); + + return $str; + +}

« previous php.gtk.webmaster (#23) next »