note 33480 added to function.str-replace

From: Date: Fri, 27 Jun 2003 09:08:33 +0000
Subject: note 33480 added to function.str-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-51085@lists.php.net to get a copy of this message
An excellent way of making sure your pages don't contain "invalid entities", IE. Valid HTML is using the following function. Most forum packages / extensions provide output containing the symbol &, we don't want this! function include_safe ($file) { $array = file($file); foreach ($array as $line) { print str_replace("&", "&", $line); } } The same technique could also be used in conjuntion with htmlmspecialchars or htmlentities. ---- Manual Page -- http://www.php.net/manual/en/function.str-replace.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33480 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33480&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33480&report=yes

« previous php.notes (#51085) next »