how can I read files into PHP. I can make a listing of a directory, but
reading the file content into the PHP goes wrong.
==== script ==========
<?php
$handle=opendir('nieuws');
while (false!==($file = readdir($handle))) {
if ($file != "." && $file != "..") {
$fp = fopen($file,"rb");
fpassthru($fp);
fclose($fp);
echo $fp;
echo "<HR>";
}
}
closedir($handle);
?>
===========
Thanx,
Marco J.L.
Try this:
$handle = opendir('nieuws');
while (false!==($file = readdir($handle))) {
if ($file != "." && $file != "..") {
readfile($file);
echo "<HR>";
}
}
closedir($handle);
Cheers,
NC
array_map('readfile', glob('nieuws/*.*'));