fork download
  1. <?php
  2.  
  3. $numeros = array('one' => 1, 'two' => 2, 'three' => 3, 'my_one' => 55, 'my_two' => 33);
  4. $myNumeros = preg_grep('/^my_.*/', array_keys($numeros));
  5.  
  6. print_r($myNumeros);
Success #stdin #stdout 0.02s 24144KB
stdin
Standard input is empty
stdout
Array
(
    [3] => my_one
    [4] => my_two
)