fork download
  1. <?php
  2.  
  3. $array = array(1, 234, 3456, 45532, 33532, 235555, 432);
  4.  
  5. $filtered = array_filter($array, function($v){
  6. return !!(is_int($v)&&strlen($v)==5);
  7. });
  8.  
  9. print_r($filtered);
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
Array
(
    [3] => 45532
    [4] => 33532
)