Siema mam kilka pytan odnośnie XML
1. Czy ten XML ma poprawną strukturę ?
2. Czy ma 2klasy , 2egzemplarze typu i 5 wartości
i 3. Czy poprawnie wypisuję dane tym, i ładuje plik? :
Czy mozna lepiej ? :P
$plik = simplexml_load_file("xml.xml"); //Zawartość pliku do tablicy
foreach($plik as $wartosc) { //Pętla
echo "$wartosc->title<br />"; //autor książki
// echo "Cena: $wartosc->title<br />"; //cena książki
}
<list>
<Movie>
<title>Harry Potter i Kamień Filozoficzny</title>
<type>Familijny, Fantasy, Przygodowy</type>
<direction>Chris Columbus</direction>
<production>USA, Wielka Brytania</production>
<premiere>18 stycznia 2002 (Polska)</premiere>
</Movie>
<Movie>
<title>Harry Potter i Komnata Tajemnic</title>
<type>Familijny, Fantasy, Przygodowy</type>
<direction>Chris Columbus</direction>
<production>USA, Wielka Brytania</production>
<premiere>19 luty 2006 (Polska)</premiere>
</Movie>
<TVseries>
<title>Dr House</title>
<season>1</season>
<type>Dramat, Komedia</type>
<direction>David Shore</direction>
<production>USA</production>
<premiere>10 styczeń 2004 (Polska)</premiere>
</TVseries>
<TVseries>
<title>Dr House</title>
<season>2</season>
<type>Dramat, Komedia</type>
<direction>David Shore</direction>
<production>USA</production>
<premiere>15 luty 2005 (Polska)</premiere>
</TVseries>
</list>