I have this line of code in php
echo '<h1>' . fread($myfile,filesize("names.txt") . '</h1>');
when I try to run the code it says * Notice: A non well formed numeric value encountered * can anyody help? thanks.
I have this line of code in php
echo '<h1>' . fread($myfile,filesize("names.txt") . '</h1>');
when I try to run the code it says * Notice: A non well formed numeric value encountered * can anyody help? thanks.
There is a typo.
echo '<h1>' . fread($myfile,filesize("names.txt")) . '</h1>';
The fread included h1
after the filesize function.
It is probably because names.txt does not exist. Try to
var_dump(file_get_contents('names.txt'))
in the line before to check that it indeed exists.