Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

filter array in php with passing extra params

$a = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
$p = 5;
 
$r = array_filter($a, function($i) use ($p) { return $i < $p; });
print_r($r);
Source by www.stetsenko.net #
 
PREVIOUS NEXT
Tagged: #filter #array #php #passing #extra #params
ADD COMMENT
Topic
Name
2+1 =