fork download
  1. <?php
  2.  
  3. $numeros = array('one' => 1, 'two' => 2, 'three' => 3, 'my_one' => 55, 'my_two' => 33);
  4.  
  5. $myNumeros = array_filter(array_keys($numeros), function ($chave){
  6. return (strpos($chave, 'my_') !== false);
  7. });
  8.  
  9. print_r($myNumeros);
Success #stdin #stdout 0.02s 24448KB
stdin
Standard input is empty
stdout
Array
(
    [3] => my_one
    [4] => my_two
)