Kasuke_Akira Posted March 3, 2007 Share Posted March 3, 2007 If I were to copy and paste some code into a textbox and use PHP to parse it, how would I make sure that each line is recognized as a new entry. I have 6 categories that I will be parsing for, and running the text through a while() loop till it gets each set of information. So, basically, it will loop through 6 times, putting the appropriate information into the variables, putting those into the mySQL databse, and then starting over with the next 6 lines as a new entry into the databse. It's just that I need to know how to make sure the PHP only parses one line at a time of the pasted text. This is an example of what exactly will be going into the textbox. except "CardName:" etc, will be replaced with different text for each set. <tr><td class="TextResultsRowHeader">CardName:</td> <tr><td class="TextResultsRowHeader">Cost:</td> <tr><td class="TextResultsRowHeader">Type:</td> <tr><td class="TextResultsRowHeader">Pow/Tgh:</td> <tr><td class="TextResultsRowHeader">Rules Text:</td> <tr><td class="TextResultsRowHeader">Set/Rarity:</td> <tr><td> </td><td> </td></tr> //this line will indicate to start over by resetting the counter <tr><td class="TextResultsRowHeader">CardName:</td> <tr><td class="TextResultsRowHeader">Cost:</td> <tr><td class="TextResultsRowHeader">Type:</td> <tr><td class="TextResultsRowHeader">Pow/Tgh:</td> <tr><td class="TextResultsRowHeader">Rules Text:</td> <tr><td class="TextResultsRowHeader">Set/Rarity:</td> <tr><td> </td><td> </td></tr> //this line will indicate to start over by resetting the counter Link to comment https://forums.phpfreaks.com/topic/41015-new-line-parsing/ Share on other sites More sharing options...
Kasuke_Akira Posted March 3, 2007 Author Share Posted March 3, 2007 useless Link to comment https://forums.phpfreaks.com/topic/41015-new-line-parsing/#findComment-198679 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.