Reliably Remove Newlines From String
<p>The string input comes from textarea where users are supposed to enter every single item on a new line.</p>

<p>When processing the form, it is easy to explode the textarea input into an array of single items like this:</p>

<pre><code>$arr = explode("\n", $textareaInput);
</code></pre>

<p>It works fine but I am worried about it not working correctly in different systems (I can currently only test in Windows). I know newlines are represented as \r\n or as just \r across different platforms. Will the above line of code also work correctly under Linux, Solaris, BSD or other OS?</p>
