XML to PHP product display code help please



Hello i need help to make a product display page from xml file .... any one who can help me thanks


i got an xml file products.xml



<PRODUCT>
<PRODUCTS_NAME>Name of the product</PRODUCTS_NAME>
<PRODUCTS_DESCRIPTION>Details of the products.</PRODUCTS_DESCRIPTION>
<PRODUCTS_IMAGE>1111.jpg</PRODUCTS_IMAGE>
<PRODUCTS_PRICE>44$</PRODUCTS_PRICE>
</PRODUCT>


ok i used this code to get information of all the product name on the page



<?php $xml=simplexml_load_file("products.xml") or die("Error: Cannot create object");
foreach($xml->children() as $products) {
echo $products->PRODUCTS_NAME. "<br>";
} ?>


its show all product name line by line ok so all i want to show full product one by one ... For example ( Product image | then product name | Then product price | Then product details )


Thanks for your help in advanced


waiting for your answers


No comments:

Post a Comment