I'm attempt to extract information from a string, which will always be in the same format.
The format will always be:
To:
Name here
Date:
26/08/2014 14:52
Order Number:
123456
Service Required:
Plumbing
Service Response:
48 Hour
Service Limit:
110.00
123 TEST ROAD
LEEDS
LS1 1HL
Contact:
Mr J Smith - 0777 123456
Telephone:
01921 123456
Work Details:
Notes here etc
I have tried exploding the string by spaces and looping through the array but I cannot structure it in such a way that I receive the information.
E.g: I try to retrieve "Name here" from after "To:" without also retrieving "Date: etc..", the eventual idea is to create variables for each bit of information so i can enter it into a database.
Any help/suggestions/idea's are really welcome.
thanks for reading