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
Splitting on ASCI line breaks then comparing records to iden
Moderator: General Moderators
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: Splitting on ASCI line breaks then comparing records to
Have you tried this?
Code: Select all
$form = explode("\n", $form);