note 21831 added to function.htmlentities
| From: | wildleaf at wildleaf dot net | Date: | Tue, 28 May 2002 19:11:31 +0000 |
| Subject: | note 21831 added to function.htmlentities | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-31109@lists.php.net to get a copy of this message | ||
If you want to display the source of an HTML file you have, just insert the following code wherever
you want to display the code:
$content = file($DOCUMENT_ROOT . "YOUR_DOCUMENT.html");
$content = implode("", $content);
$content = htmlentities($content);
$content = ereg_replace ("\n", "<br>", $content);
$content = ereg_replace (" ", " ", $content);
print ( $content );
--
http://www.php.net/manual/en/function.htmlentities.php
http://master.php.net/manage/user-notes.php?action=edit+21831
http://master.php.net/manage/user-notes.php?action=delete+21831
http://master.php.net/manage/user-notes.php?action=reject+21831