Nemus Posted April 3, 2008 Share Posted April 3, 2008 Hello, I am trying to parse textarea data by row thats submitted from a form. so I have a text area with : input1row1 input2row2 which comes as the $inputString = " input1row1 input2row2"; but when I explode (" ", $inputString) the data doesn't parse by the blank space if i put spaces at the end in the the text area, then it does parse. so I am wondering is there a special text area variable in side the string i can use to parse textarea rows? here is my code.: $self = $_SERVER['PHP_SELF']; $lanMacs = $_REQUEST['ltextarea']; $splitdata = explode(",", "$textarea"); foreach ($splitdata as $value) { echo "<br>: $value<br>\n"; } the out put is one whole string Link to comment https://forums.phpfreaks.com/topic/99442-form-text-area-parse-not-working-with-explode/ Share on other sites More sharing options...
devstudio Posted April 3, 2008 Share Posted April 3, 2008 New lines in text areas are "\n". Explode on \n and you should get what you are looking for. Best, Nathan Link to comment https://forums.phpfreaks.com/topic/99442-form-text-area-parse-not-working-with-explode/#findComment-508852 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.