Devon Denim Jacket
ID: 3852333 • Letter: D
Question
Ok my first question was not answered correctly so here is my second attempt I need to create a wildlife image gallery page with PHP using an XML configuration file. It has to have 32 wildlife pics 31 jpg pics and 1 Png pic. Can i get help with this code can you make it readable and make sure it works.
Thanks.
Explanation / Answer
So i managed to find out the answer .. the if function need to be inserted inside the foreach function which i didnt put it before .. ?php $productID = $_GET['product_id']; $xml = simplexml_load_file("product.xml"); $searchedproduct = $xml->xpath('/products/product[product_id="'.$productID.'"]'); foreach($searchedproduct as $productinfo){ foreach ($productinfo as $productdetail){ if($productdetail->getName($image) == 'image_path'){ echo 'Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.