read first line of txt php code example
Example 1: php get first character of string
$firstStringCharacter = substr("hello", 0, 1);
Example 2: read line by line php
<?php
$file = new SplFileObject("file.txt");
while(!$file->eof())
{
echo $file->fgets()."<br/>";
}
$file = null;
?>