note 41556 added to function.file

From: Date: Wed, 14 Apr 2004 14:55:48 +0000
Subject: note 41556 added to function.file
Groups: php.notes 
Request: Send a blank email to php-notes+get-68124@lists.php.net to get a copy of this message
This is just a presentation idea extending the php example. Anchor links as line numbers and the document in a table data field of it's own so it can be easily copy/pasted. <?php $lines=file("http://www.example.com"); echo "<table border=1><tr><td>\n"; foreach ($lines as $line_num => $line) { echo "<a name=".$line_num."><a href=\"#".$line_num."\">".$line_num."</a><br>\n"; } echo "</td><td>\n"; foreach ($lines as $line_num => $line) { echo htmlspecialchars($line)."<br />\n"; } echo "</td></tr></table>\n"; ?> ---- Manual Page -- http://www.php.net/manual/en/function.file.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+41556 Delete -- http://master.php.net/manage/user-notes.php?action=delete+41556&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+41556&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#68124) next »