Read from XML file and write to a php file
I need to update the country list of my website and I want to automate the process. Country list can be found here
In that XML file they have given the data is in following format
I need to read the XML file and get the data then write this in a PHP file in following format. (I prefer the DOM method)
$countries["AF"] = "Afghanistan";
$countries["AL"] = "Albania";
$countries["DZ"] = "Algeria";
Any help in this regards is much appreciated.