Andromeda Andromeda -4 years ago 109
PHP Question

Converting content of text area into an array

I have a form with a text area in html.
I want to get the content of this text area in php so that each line can be stored in an array. I tried using implode with'/n'. but its not working. how can i do that.

Here is my code

$notes = explode('/n',$_POST['notes']);

Answer Source

You need to use this:

$notes = explode("\n", $_POST['notes']);

(Back slash, not forward slash, and double quotes instead of single quotes)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download