Ojala me ayuden con esto:
tengo un xml como la que pongo abajo y lo estoy leyendo con este codigo
Código PHP:
$fxml=file_get_contents("http://midominio.com/filexml.xml");
$xml = new SimpleXMLElement($fxml);
foreach ($xml->schedule->movie as $movie){
echo $movie->movie_id;
echo $movie->movie_no;
}
esto no me sirvio
Código PHP:
foreach ($xml->schedule->movie->showtimes->showtime as $st){
echo $st;
}
Código HTML:
<schedule> <movie> <movie_id>104908</movie_id> <movie_name>Fort McCoy</movie_name> <movie_rating>R</movie_rating> <showtimes attributes="" sound="" allowpasses="Yes" comments=""> <showtime>13:50</showtime> <showtime>16:30</showtime> <showtime>19:10</showtime> <showtime>21:40</showtime> </showtimes> </movie> <movie> <movie_id>161906</movie_id> <movie_name>Five Star Life (Viaggio sola), A</movie_name> <movie_rating>NR</movie_rating> <showtimes attributes="" sound="" allowpasses="Yes" comments=""> <showtime>12:40</showtime> <showtime>17:20</showtime> </showtimes> </movie> <movie> <movie_id>163602</movie_id> <movie_name>Zulu</movie_name> <movie_rating>NR</movie_rating> <showtimes attributes="" sound="" allowpasses="Yes" comments=""> <showtime>19:30</showtime> </showtimes> </movie> <movie> <movie_id>168086</movie_id> <movie_name>Begin Again</movie_name> <movie_rating>R</movie_rating> <showtimes attributes="" sound="" allowpasses="Yes" comments=""> <showtime>13:40</showtime> <showtime>16:20</showtime> </showtimes> </movie> </schedule>