问题
I have a local xml file which I am trying to display over a webpage with following code.
All I get is a blank page.
enter code here
<?php
$xml_content = file_get_contents("C:\Users\user\Downloads\93D7.xml");
$data = simplexml_load_string($xml_content);
foreach ($data->item as $item) {
var_dump($item->bookname);
}
?>
Once the display works, I want to have a drop down where I will select the xml element / entity and it will display the value or child of that element / entity.
Can someone help?
I referred : Get multiple items from XML with SimpleXML & populating dropdown with values from xml file in php
Both individually gives me a blank page.
来源:https://stackoverflow.com/questions/58808352/display-xml-file-cascaded-contents-in-a-drop-down-via-php