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
You can normalize the input:
"\n", "\r" => "\n", "\n" => "\n", )); ?>
Alternatively, you can explode with regular expressions: