In PHP 5.3 there is a nice function that seems to do what I want:
strstr(input,\"\\n\",true)
Unfortunately, the server runs PHP 5.2.17 and the
not dependent from type of linebreak symbol.
(($pos=strpos($text,"\n"))!==false) || ($pos=strpos($text,"\r")); $firstline = substr($text,0,(int)$pos);
$firstline now contain first line from text or empty string, if no break symbols found (or break symbol is a first symbol in text).