I have a text area form which takes data like this:
The goal is to get this data into a mysql table whose fields are id, user, pw.Code:user1:pass1 user2:pass2 user3:pass3
To split the lines I use:
Now I am not sure how to proceed. I need two separate arrays that will contain the user and pw values. I cant use explode like for this because it would separate them into a single array.Code:$text = $_POST['text']; $data = explode(explode("/\r\n|\r|\n/", $text); //split text area by line




Reply With Quote