starting the chapter on files

This commit is contained in:
Dan Buch 2010-12-30 13:57:54 -05:00
parent da075b76ba
commit 15b891ff97
2 changed files with 36 additions and 0 deletions

7
docroot/html/data.txt Normal file
View File

@ -0,0 +1,7 @@
dogs
cats
babies
monkeys
hats
dollars
ham

29
docroot/html/files.php Normal file
View File

@ -0,0 +1,29 @@
<?php
require_once('_head.php');
mkheader('files!', '#aaa');
?>
<body>
<!-- ======================================================= -->
<pre><?php
// do nothing!
$handle = fopen('data.txt', 'r');
fclose($handle);
?></pre>
<!-- ======================================================= -->
<pre><?php
// get everything!
echo file_get_contents('data.txt');
?></pre>
</body>
</html>