Peculiar problem with file handling in php
Posted: Thu Jun 23, 2005 4:33 am
All,
The fread function doesn't seem to work at all. Can someone please help me.
<?
$myFile = "C:\program files\Apache Group\Apache2\htdocs\test.txt";
$fileread = fopen($myfile, "rb");
echo "Reading the file now";
$theData = fgets($fileread);
echo $theData;
?>
Warning message
Reading the file now
Warning: fgets(): supplied argument is not a valid stream resource in C:\program files\Apache Group\Apache2\htdocs\filehandle2.php on line 5
The fread function doesn't seem to work at all. Can someone please help me.
<?
$myFile = "C:\program files\Apache Group\Apache2\htdocs\test.txt";
$fileread = fopen($myfile, "rb");
echo "Reading the file now";
$theData = fgets($fileread);
echo $theData;
?>
Warning message
Reading the file now
Warning: fgets(): supplied argument is not a valid stream resource in C:\program files\Apache Group\Apache2\htdocs\filehandle2.php on line 5