I have a multi-dimensional array in the following format:
[0] = ( \'id\' => \'1\', \'type\' => \'fish\', \'owner\' => \'bob\', ) [1] =
Loop through the array:
function loopAndFind($array, $index, $search){ $returnArray = array(); foreach($array as $k=>$v){ if($v[$index] == $search){ $returnArray[] = $v; } } return $returnArray; } //use it: $newArray = loopAndFind($oldArray, 'type', 'cat');