Don't think either of those will help
basically if I have an array containing
Code:
$details =array(0 => array('desk' => 'wood', 'computer => 'mac'),
1 =>array('desk' => 'steel', 'computer => 'mac'))
I want to be able to search that array by passing another array to a function
eg
Code:
$search = array('desk'=>'wood', 'computer'=>'mac');
function search($search)
{
for($i=0; $<count($details); $i++) {
/*This is where I would need to print the $order array as foreach ($search as $key to value)*/
if($details[$i]['desk'] == 'wood && $details[$i]['computer'] == 'mac') {
//Do something
}
}
}
if
Code:
$search = array('desk'=>'wood');
then it would just be
Code:
function search($search)
{
for($i=0; $<count($details); $i++) {
/*This is where I would need to print the $order array as foreach ($search as $key to value)*/
if($details[$i]['desk'] == 'wood) {
//Do something
}
}
}
Bookmarks