Add exams from exam100 to exam150
This commit is contained in:
26
exam104/example.xml
Executable file
26
exam104/example.xml
Executable file
@@ -0,0 +1,26 @@
|
||||
<producers>
|
||||
<producer>
|
||||
<name>Alex</name>
|
||||
<age>21</age>
|
||||
<show>
|
||||
<showname>A show</showname>
|
||||
<showdate>12th December 2010</showdate>
|
||||
</show>
|
||||
<show>
|
||||
<showname>Another show</showname>
|
||||
<showdate>23th Novembar 2024</showdate>
|
||||
</show>
|
||||
</producer>
|
||||
<producer>
|
||||
<name>Nikola</name>
|
||||
<age>16</age>
|
||||
<show>
|
||||
<showname>Better show</showname>
|
||||
<showdate>25th Novembar 2007</showdate>
|
||||
</show>
|
||||
</producer>
|
||||
<producer>
|
||||
<name>Dale</name>
|
||||
<age>49</age>
|
||||
</producer>
|
||||
</producers>
|
||||
13
exam104/index.php
Normal file
13
exam104/index.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
//Reading a XML file
|
||||
$xml = simplexml_load_file('example.xml');
|
||||
|
||||
foreach($xml->producer as $producer){
|
||||
echo $producer->name.' ('. $producer->age .')'. "<br>";
|
||||
foreach($producer->show as $show){
|
||||
echo $show->showname. ' ('.$show->showdate.')' .'<br>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user