Guest Posted March 5, 2007 Share Posted March 5, 2007 How can i make a script that will execute code for each line input on a text field? for each line I would want it to test for certain conditions and insert it into the database i know how to do that but i do not know how to extract each line. Quote Link to comment https://forums.phpfreaks.com/topic/41305-solved-for-each-line/ Share on other sites More sharing options...
flappy_warbucks Posted March 5, 2007 Share Posted March 5, 2007 are you trying to read a CSV file or something? Quote Link to comment https://forums.phpfreaks.com/topic/41305-solved-for-each-line/#findComment-200134 Share on other sites More sharing options...
Guest Posted March 5, 2007 Share Posted March 5, 2007 Yea sordof except it is seperated by line. Quote Link to comment https://forums.phpfreaks.com/topic/41305-solved-for-each-line/#findComment-200136 Share on other sites More sharing options...
Guest Posted March 5, 2007 Share Posted March 5, 2007 Can this be done? Quote Link to comment https://forums.phpfreaks.com/topic/41305-solved-for-each-line/#findComment-200158 Share on other sites More sharing options...
Guest Posted March 5, 2007 Share Posted March 5, 2007 I was looking online and the only thing that i could find would be to turn it into a array by the \n how can i do this? Quote Link to comment https://forums.phpfreaks.com/topic/41305-solved-for-each-line/#findComment-200162 Share on other sites More sharing options...
boo_lolly Posted March 5, 2007 Share Posted March 5, 2007 I was looking online and the only thing that i could find would be to turn it into a array by the \n how can i do this? '\n' is the carraige return command in a string. it has nothing to do with a sql query. you are correct, however, that it would be best to use in an array. so, does each input field have it's own requirements? or are they all the same requirements? Quote Link to comment https://forums.phpfreaks.com/topic/41305-solved-for-each-line/#findComment-200166 Share on other sites More sharing options...
Psycho Posted March 5, 2007 Share Posted March 5, 2007 Use file() which will return the results in an array based upon lines in the document: http://us2.php.net/file Quote Link to comment https://forums.phpfreaks.com/topic/41305-solved-for-each-line/#findComment-200168 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.