I'm just start learning php and have a question about feof(). I wanna read 2 strings from txt file and put it into two variables. But something going wrong, because var_dump show me FALSE.
$fbhand = fopen("c://study/file.txt","r");
while (!feof($fbhand)) {
$fizz = fgets($fbhand);
$buzz = fgets($fbhand);
}
Before that i created this file and put there 2 numbers from STDIN and W+, than closed file.
function dataEntry() {
$fbfile = ("c://study/file.txt","w+");
$handler = fopen("php://stdin", "r");
echo "enter f \n";
$f = fgets($handler);
fwrite($fbfile, $f);
echo "enter b\n";
$b = fgets($handler);
fwrite($fbfile,$b);
fclose($fbfile);
}
what i'm doing wrong?