Toggle navigation
Home
Latest pastes
FAQ
Random
Register
Login
Filter the values of an array using a callback function:
SUBMITTED BY:
henry1874w
DATE:
June 23, 2017, 9:26 p.m.
FORMAT:
Text only
SIZE:
128 Bytes
Raw
Download
Tweet
HITS:
283
Go to comments
Report
<?php
function test_odd($var)
{
return($var & 1);
}
$a1=array("a","b",2,3,4);
print_r(array_filter($a1,"test_odd"));
?>
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus