How to read a single character (first character) from a text file in PHP

1 Answer

0 votes
$f = fopen("e:/numbers.txt", "r") or die("Error open file!");
echo fgetc($f);
fclose($f);


/*
run:

1

*/

 



answered Dec 3, 2015 by avibootz
edited Dec 5, 2015 by avibootz
...