Re: [php-gtk-webmaster] cvs: php-gtk-web /include shared-manual.inc
| From: | Andrei Zmievski | Date: | Sat, 01 Sep 2001 17:27:31 +0000 |
| Subject: | Re: [php-gtk-webmaster] cvs: php-gtk-web /include shared-manual.inc | ||
| References: | 1 | Groups: | php.gtk.webmaster |
| Request: | Send a blank email to php-gtk-webmaster+get-24@lists.php.net to get a copy of this message | ||
James, it's faster to use str_replace for this...
At 06:56 PM 9/1/01 +0000, James Moore wrote:
-Andreijmoore Sat Sep 1 14:56:56 2001 EDTModified files:/php-gtk-web/include shared-manual.incLog: - Add the dehtmlspecialchars function that allows usto 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 > 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("%>%",">",$str); + $str = preg_replace("%<%","<",$str); + $str = preg_replace("%"%","\"",$str); + $str = preg_replace("%&%","&",$str);++ return $str;+ +} -- PHP-GTK Webmaster Mailing List (http://gtk.php.net/) To unsubscribe, e-mail: php-gtk-webmaster-unsubscribe@lists.php.net For additional commands, e-mail: php-gtk-webmaster-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net