10-02-2009, 01:06 PM
|
#1 (permalink)
|
|
The Visitor
Join Date: Oct 2009
Location: Sweden
Posts: 3
Thanks: 1
|
Searching through multidimensional arrays
Hi,
I need advice about searching through multidimensional arrays.
My array contains product data for a webshop. This is the structure:
PHP Code:
$array = array( $category =>
array( $product =>
$id,
$title,
$price,
etc... ));
There is several categories and in each category many products with it's data. What is a good way to search such an array for a product with a certain ID? I need the keys for each dimension returned so I can extract data from that product.
Is there a way to do this without having nested foreach loops?
Tell me If I am not clear enough.
Any help is greatly appreciated!
/Swiftaxe
|
|
|
|