Textarea into an array or implode?
- by Kyle R
Say I have a text area, user enters information exactly like styled below:
Ice cream
Chocolate
then submits this information, I want to retrieve the information EXACTLY like so:
Ice cream, Chocolate
Is this the best way to do it:
$arr = explode("\n", $var);
$arr = implode(",", $arr);
When doing it like this, it puts the information out like so:
Ice cream , Chocolate
Note the space after cream, will a simple trim() fix this?