note 72783 added to function.file

From: Date: Thu, 01 Feb 2007 15:26:03 +0000
Subject: note 72783 added to function.file
Groups: php.notes 
Request: Send a blank email to php-notes+get-122476@lists.php.net to get a copy of this message
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"; } ?> ---- Server IP: 64.71.164.2 Probable Submitter: 65.198.69.3 (proxied: 1.1 NYPROXYWIN01) ---- Manual Page -- http://www.php.net/manual/en/function.file.php Edit -- https://master.php.net/note/edit/72783 Del: integrated -- https://master.php.net/note/delete/72783/integrated Del: useless -- https://master.php.net/note/delete/72783/useless Del: bad code -- https://master.php.net/note/delete/72783/bad+code Del: spam -- https://master.php.net/note/delete/72783/spam Del: non-english -- https://master.php.net/note/delete/72783/non-english Del: in docs -- https://master.php.net/note/delete/72783/in+docs Del: other reasons-- https://master.php.net/note/delete/72783 Reject -- https://master.php.net/note/reject/72783 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#122476) next »