NLCJ Posted September 10, 2010 Share Posted September 10, 2010 Hello, I've got two questions. Users can fill in a form with information that has to be in the following format: Value 1,Value 2,Value 3,Value 4 Value 1,Value 2,Value 3,Value 4 Now I want to return an error if ANY line isn't in that format. For example when it's like this: Value 1,Value 2,Value 3,Value 4 Value 1,Value 3,Value 4 I've got no clue how to do that... The second question is, how can I get a specific line of the posted information? I've already gotten an answer on how to count those lines, which is working. But I'm going to insert them into the database using a for loop, so I need to insert one row at a time. Thanks for your time and help, Chris Link to comment https://forums.phpfreaks.com/topic/213076-importing-lines-and-returning-errors/ Share on other sites More sharing options...
NLCJ Posted September 11, 2010 Author Share Posted September 11, 2010 I've solved it, I suddenly thought of the solution. Weird! I've used: $postedinfo = explode("\r\n", $_POST['information']); To get the information, then it can be requested by using: echo $postedinfo[0] For line 1, and echo $postedinfo[1] For line 2 etc. Link to comment https://forums.phpfreaks.com/topic/213076-importing-lines-and-returning-errors/#findComment-1109906 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.