0

I'm trying to figure out a way to import some XML data into HTML/PHP web page. I'm creating website for movies and with the movie data to be extracted from XML file because that way I'd be able to change just the file and it'll be easier for maintenance. Here is the XML file:

 <?xml version="1.0" encoding="UTF-8"?>
    <movie100001>
        <title>Movie Title 1</title>
        <year>2016</year>
        <director>Zack Dodgers</director>
        <director>Robert Zemeckis</director>
        <actor>Marlon Brando</actor>
        <actor>Brandon Frazer</actor>
        <actor>50 Cent</actor>
        <actor>Pamela Anderson</actor>
        <actor>Bon Scott</actor>
        <actor>Jonathan Davies</actor>
        <plot>Its a sample plot, noone cares about what does this field say.</plot>
        <genre>Action</genre>
        <genre>Horror</genre>
        <genre>Comedy</genre>
    </movie100001>

I wish to have the actors separated by comma, the genres as well. If possible, I'd add links to the genre/s (and/or actors) which would add more depth to the website. For example "genre"

  • What did you try ? – JazZ Feb 21 '17 at 18:41
  • You could try google first. Then, come back here if something went wrong or if you are stuck somewhere. [PHP SimpleXML Parser](https://www.w3schools.com/php/php_xml_simplexml_read.asp) – JazZ Feb 21 '17 at 18:46
  • You can find this on google, just like @JazZ mentioned. You should show the effort you put in before asking here. – BusyProgrammer Feb 21 '17 at 21:49

0 Answers0