more work with file io

cat-town
Dan Buch 14 years ago
parent 15b891ff97
commit e39e9cc091

@ -13,6 +13,7 @@ mkheader('files!', '#aaa');
// do nothing!
$handle = fopen('data.txt', 'r');
fclose($handle);
print "didn't actually do anything here ...";
?></pre>
@ -25,5 +26,19 @@ mkheader('files!', '#aaa');
?></pre>
<!-- ======================================================= -->
<pre><?php
$lines = file('data.txt');
foreach($lines as $key => $line) {
$linenum = $key + 1;
print "Line $linenum: $line";
}
?></pre>
</body>
</html>

Loading…
Cancel
Save