function odd( $var) {return ($var 2 == 1)} function even($var) {return ($var 2 == 0)} $pole1 = array (a= 1 b= 2 c= 3 d= 4 e= 5) $pole2 = array (6 7 8 9 10 11 12) echo odd \n print_r(array_filter($pole1 odd)) echo even\n print_r(array_filter($pole2 even))