I have the following xml feed:
<tourName>Amazon Riverboat Adventure</tourName>
<tripDetail type="StartFinish">ex Lima</tripDetail>
<tripDetail type="What's Included">Lots of stuff </tripDetail>
<tripDetail type="Whats not included">Not much </tripDetail>
I need a way to be able to save each of the tripDetails as a seperate value. The "types" are always constant and i have a list of them.
I therefore want to be able to say $startfinish = 'ex Lima', $whatsincluded = 'Lots of stuff' etc.
The code i have so far is:
trigger_error('Error reading XML file',E_USER_ERROR);
foreach ($xml->tourName as $tourname)
foreach ($xml->dossierCode as $agentcode)
which obviously get's me the first two instances of the XML. When i move onto the tripDetail section though, i tried to use:
foreach ($xml->tripDetails->tripDetail as $startfinish)
this didn't produce anything. If i remove the , it just displays the last result in the array.
Any help - greatly appreciated!