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 Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.