$a = readfile('myfile.txt'); //you can read whole file in php echo $a; //it will return character of length also.