note 72783 deleted from function.file by bobby
| From: | bobby@php.net | Date: | Thu, 01 Feb 2007 15:56:10 +0000 |
| Subject: | note 72783 deleted from function.file by bobby | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-122478@lists.php.net to get a copy of this message | ||
Note Submitter: somnathnag at yahoo dot com
----
When I use file - all the leading spaces are deleted - how can I keep those indentation. I need this
just to display a readable code.
For example :
Say I run this php file called a.php
<?php
$lines = file('a.php');
// Loop through our array
foreach ($lines as $line)
{
echo htmlentities($line) . "<br />\n";
}
?>
The o/p is :
<?php
$lines = file('a.php');
// Loop through our array
foreach ($lines as $line)
{
echo htmlspecialchars($line) . "<br />\n";
}
?>