fopen( ) and fread( )
<?
$filename = 'data.txt';
$fh_flowers = fopen("data.txt", "r") OR die ("Can't open the file!\n");
$fh_logfile = fopen("$appname-log.log", "w") OR die ("Log file not writeable!\n");
$handle = fopen($filename, "a");
if (!$handle) {
print "Failed to open $filename for appending.\n";
}
?>
Related examples in the same category