convert xml to array php – you can use simplexml_load_string() amd The xml_parse_into_struct() function parses XML data into an array.
convert xml to array php
we will explain to you how to convert XML into associative array in PHP. Let’s see bellow example php xml to array example.
free_download_movie.xml
This XML file does not appear to have any style information associated with it. The document tree is shown below.tamilmv $5.95 TamilMV is a very malicious site to download motion pictures and other pilfered content on the web. 650 mp3goo $7.95 Mp3goo - Download any song in mp3 format from our multi category Music databases. 900 VegaMovies $8.95 Vegamovies is an online pirated website, which leaks movies illegally. 900 Tamilrockers $4.50 Tamilrockers is a torrent website that is immensely popular among south Indian movie fans. 600 Tamilblaster $6.95 TamilBlasters New Tamil Dubbed Movies Multi Audios Telugu Kannada Malayalam Hindi Download tamilblasters. 950
PHP Code
index.php
Output
Array ( [movie] => Array ( [0] => Array ( [name] => tamilmv [amount] => $5.95 [livecomments] => TamilMV is a very malicious site to download motion pictures and other pilfered content on the web. [movierank] => 650 ) [1] => Array ( [name] => mp3goo [amount] => $7.95 [livecomments] => Mp3goo - Download any song in mp3 format from our multi category Music databases. [movierank] => 900 ) [2] => Array ( [name] => VegaMovies [amount] => $8.95 [livecomments] => Vegamovies is an online pirated website, which leaks movies illegally. [movierank] => 900 ) [3] => Array ( [name] => Tamilrockers [amount] => $4.50 [livecomments] => Tamilrockers is a torrent website that is immensely popular among south Indian movie fans. [movierank] => 600 ) [4] => Array ( [name] => Tamilblaster [amount] => $6.95 [livecomments] => TamilBlasters New Tamil Dubbed Movies Multi Audios Telugu Kannada Malayalam Hindi Download tamilblasters. [movierank] => 950 ) ) )
Don’t Miss : Convert Array To XML And XML To Array Using PHP
I hope you get an idea about convert xml to array php.
I would like to have feedback on my infinityknow.com.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.