i keep getting the: Resource id #4 as my output each time i try to run this script. where am i going wrong.
<?PHP
$file_contents = fopen("testFile.txt", "r");
print $file_contents;
fclose($file_contents);
?>
what is the meaning of this Resource id #4
Moderator: General Moderators
Re: what is the meaning of this Resource id #4
It's a file handle. If you need the file contents use filegetcontents instead of fopen OR you should read the file line by line -fgets(), or block by block - fread() after opening it.tinoda wrote:i keep getting the: Resource id #4 as my output each time i try to run this script. where am i going wrong.
<?PHP
$file_contents = fopen("testFile.txt", "r");
print $file_contents;
fclose($file_contents);
?>
There are 10 types of people in this world, those who understand binary and those who don't
Re: what is the meaning of this Resource id #4
you know what Vladsun you are just the person of the day today. u really brightened my day, vielen danke, thank u very much - it workedIt's a file handle. If you need the file contents use filegetcontents instead of fopen OR you should read the file line by line -fgets(), or block by block - fread() after opening it.