stubarny1 Posted December 14, 2010 Share Posted December 14, 2010 Hello everyone, I have a webpage that needs to accept the old version of a list of records, the new version of a list of records and then output a list of records that are new or have been updated. The webpage has 2 text cells. The 1st text cell for the old set of records to be added. Example input: “ Company1 title Company 1 details Company 2 title Company 2 details Company3 title Company3 details “ The 2nd text cell has a text cell for the new set of records to be added. Example input: “ Company1 title Company 1 details (updated) Company 2 title Company 2 details Company3 title Company3 details Company4 title Company4 details ” On submission of the form the following output should be given (i.e. the updated record and the new record): “ Company1 title Company 1 details (updated) Company4 title Company4 details “ I’ve become stuck because I can’t split the form variables at ASCI line breaks into arrays. Please could someone point me in the right direction? (Google doesn’t appear to have anything so I’m wondering whether it’s even possible to split by ASCI line break?) Many thanks! Stu Quote Link to comment https://forums.phpfreaks.com/topic/221679-splitting-on-asci-line-breaks-then-comparing-records-to-identify-updated-records/ Share on other sites More sharing options...
jdavidbakr Posted December 14, 2010 Share Posted December 14, 2010 $array = explode("\n",$data); will break up $data into an array based on line breaks, is that what you're looking for? Quote Link to comment https://forums.phpfreaks.com/topic/221679-splitting-on-asci-line-breaks-then-comparing-records-to-identify-updated-records/#findComment-1147395 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.