i have an array something like given below is it possible to find the key index of the array if i provide a slab id value in php?
Array ( [0
Something like that :
function getIndex($array, $slabId) { foreach($array as $index => $item) { if($item->slabId == $slabId) return $index; } }