This question can be broken down into two parts; reading a file and scanning a string for a newline character. Let's deal with each of them seperately. There are many functions available for reading files, the simplest of which, so long as the file is relatively small, is [man]file_get_contents[/man].
$data = file_get_contents( $path );
Next, finding a new line character, very simply can be done with [man]strpos[/man].
if( ($i = strpos( $data, "\n" )) !== false ) {
echo "A newline character was found at position $i\n";
}