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
here you go
$str = strtok($input, "\n");
strtok() Documentation