3v4l.org

run code in 300+ PHP versions simultaneously
<?php $meuArrayMultidimensional = array(array("campo" => "teste"), array("campo" => "valor qualquer"), array("campo" => "teste")); $search = "teste"; $retorno = array_keys( array_filter( $meuArrayMultidimensional, function ($value) use ($search) { return (stripos($value['campo'], $search) !== false); } ) ); print_r($retorno);
Output for 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.6 - 7.2.33, 7.3.0 - 7.3.24, 7.4.0 - 7.4.13, 8.0.0
Array ( [0] => 0 [1] => 2 )