box-o-sand/docroot/html/files.php

45 lines
733 B
PHP
Raw Normal View History

2010-12-30 18:57:54 +00:00
<?php
require_once('_head.php');
mkheader('files!', '#aaa');
?>
<body>
<!-- ======================================================= -->
<pre><?php
// do nothing!
$handle = fopen('data.txt', 'r');
fclose($handle);
2010-12-31 06:46:02 +00:00
print "didn't actually do anything here ...";
2010-12-30 18:57:54 +00:00
?></pre>
<!-- ======================================================= -->
<pre><?php
// get everything!
echo file_get_contents('data.txt');
?></pre>
2010-12-31 06:46:02 +00:00
<!-- ======================================================= -->
<pre><?php
$lines = file('data.txt');
foreach($lines as $key => $line) {
$linenum = $key + 1;
print "Line $linenum: $line";
}
?></pre>
2010-12-30 18:57:54 +00:00
</body>
</html>