Jump to content

Form Text Area Parse not working with explode


Nemus

Recommended Posts

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.