Say i have a multidimensional array. For example:
Array (
[0] => Array (
[animal_id] => 5494
[animal_name] =>
You could run through the array and then crosscheck every item:
foreach($aAnimals AS $iKey => $aAnimalData
{
foreach($aAnimals AS $iSubKey => $aData)
{
if($aAnimalData['animal_type'] == $aData['animal_type'] && $iKey != $iSubKey)
{
// Start doing whatever you want to do when the types match.
// The last part makes sure the second foreach does not
// match with the first one.
}
}
}
If you specify what kind of comparing you want I could improve this answer with that.