I need a second eye on this one. I just can't figure out. I'm trying to parse the xml. It looks like below.
<?xml version="1.0" encoding="utf-8"?>
<Patient>
[INDENT]<PatientID>131</PatientID>
<FirstName>Yoyo</FirstName>
<LastName>Man</LastName>
<Images>
[INDENT]<Image>11</Image>
<Image>12</Image>
<Image>13</Image>[/INDENT]</Images>
<Descriptions>
[INDENT]<Description>
<Name>General Description</Name>
<Value>Fun to be with.</Value>
</Description>[/INDENT]</Descriptions>[/INDENT]
</Patient>
I'm trying to parse with the following code.
$strurl = "http://localhost:90/PatientDatabase_EN/111.xml";
$strpage = file_get_contents($strurl);
$objxml = new SimplexmlElement($strpage);
echo $objxml->Patient->FirstName;
The code displays blank or empty. How to extract the firstname? How do you loop thru the images too?
Thanks in advance.