title: Obtain first line of a string in PHP
body: <p>In PHP 5.3 there is a <a href="http://www.php.net/manual/en/function.strstr.php" rel="noreferrer">nice function</a> that seems to do what I want:</p>
  
  <pre><code>strstr(input,"\n",true)
  </code></pre>
  
  <p>Unfortunately, the server runs PHP 5.2.17 and the optional third parameter of <code>strstr</code> is not available. Is there a way to achieve this in previous versions in one line?</p>