note 17336 deleted from function.htmlspecialchars by jimw

From: Date: Thu, 20 Dec 2001 20:39:39 +0000
Subject: note 17336 deleted from function.htmlspecialchars by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-23406@lists.php.net to get a copy of this message
This function is great for displaying code. Let's say you have a PHP file named example.php and you want to display the code on a web page. Here's all you do: <pre> <?php $code = file("example.php"); while ($nextline = each($code)) echo htmlspecialchars($nextline["value"]); ?> </pre> Since the file's opening script tag gets converted to &lt;?php, the entire file will be displayed rather than interpreted.

« previous php.notes (#23406) next »