The string input comes from textarea where users are supposed to enter every single item on a new line.
When processing the form, it is easy to explode the textarea input into an array of single items like this:
$arr = explode("
", $textareaInput);
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 or as just across different platforms. Will the above line of code also work correctly under Linux, Solaris, BSD or other OS?
See Question&Answers more detail:os