Jump to content

Matching data between two arrays


Omzy

Recommended Posts

Why does this not work:

 

$subcats=array(
'wedding-cakes'=>array('cakes', 'Wedding Cakes'),
'birthday-cakes'=>array('cakes', 'Birthday Cakes')
);

 

$cat=array(
'cakes'=>array('Cakes', 'Wedding Cakes, Birthday Cakes')
);

 

foreach($subcats as $index1 => $value1)
if($subcats[$index1][0] == $cat)
{
//echo $subcats[$index1][1];
}

Link to comment
https://forums.phpfreaks.com/topic/139381-matching-data-between-two-arrays/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.