[ create a new paste ] login | about

Link: http://codepad.org/ppRy0PcT    [ raw code | output | fork ]

PHP, pasted on Jan 3:
1
2
3
4
5
6
7
8
9
<?php
function myFilter($var){
  return ($var !== NULL && $var !== FALSE && $var !== '');
}

$res = array_filter(array(NULL,FALSE,'',0,1), "myFilter");


var_dump($res);


Output:
1
2
3
4
5
6
array(2) {
  [3]=>
  int(0)
  [4]=>
  int(1)
}


Create a new paste based on this one


Comments: