Hi there,
I would like to be able to display multidimensional array items on another page.
I already have an array.php with the following, which also has the css etc.
PHP Code:<style type="text/css">
css for the deals is here
</style>
$deals = array(
"Nike"=> array(
array('productTitle' => "Nike Trainers 1",'productImage' => "deals/nike1.jpg",'productDescription' => " Fantastic Savings on Nike Trainers",'rrp' => "£69.99",'salePrice' => "£60.00"),
array('productTitle' => "Nike Trainers 2",'productImage' => "deals/nike2.jpg",'productDescription' => " Fantastic Savings on Nike Trainers",'rrp' => "£69.99",'salePrice' => "£60.00")),
"Addidas"=> array(
array('productTitle' => "Addidas Boots 1",'productImage' => "deals/addidas1.jpg",'productDescription' => " Fantastic Savings on Addidas Boots",'rrp' => "£69.99",'salePrice' => "£60.00"),
array('productTitle' => "Addidas Boots 2",'productImage' => "deals/addidas2.jpg",'productDescription' => " Fantastic Savings on Addidas Boots",'rrp' => "£69.99",'salePrice' => "£60.00")),
);//close $deals array
foreach ($deals as $brand =>$items)
{
echo "<div class=\"header\"><h2>$brand:</h2><br>";
echo "<div id=\"dealwrapper\">";
foreach ($deal as $items)
{
}
echo "</div>";
}
?>
This displays all the brands and deals on the one page. However I also have individual .php pages for both Nike and Addidas, and I would like to be able to display only the Nike items from the main array in Nike.php and Addidas items in Addidas.php??
I have tried this so far, which is probably way off the mark
PHP Code:
PHP Code:<?php
foreach (glob("array/*.php/{$v}") as $key => $val)
{
echo $ key =>$val;
}
?>
Any help much appreciated.
Volterony


Reply With Quote




Bookmarks