PHP |
Date: 09.09.2006
| ← 3 Reference | [ up ] - [ top ] - [ A - Z ] | 3.2 cURL → |
// write a file
$FH = fopen("zz_trash_out.txt", "w");
fwrite($FH, "Hi, World\n");
fwrite($FH, "Foo bar\n");
fclose($FH);
<?php
read_file('zz_trash_out.txt');
function read_file ( $filename, $return_max_lines=0, $callback_func=null, $do_rtrim=true, $buffer_size=1024 ) {
$FH = fopen( $filename, 'rb' );
while(1) {
$line = rtrim(fgets($FH, $buffer_size));
if (feof($FH)) { break; }
print "==> \"$line\"\n";
}
fclose($FH);
}
?>
copyright by reto - created with mytexi