Using The Array_Filter() Function

<?phpphp    function filter_values($value) {
        if($value > 10) return true;
        return false;
    }    $myints = array(123,45,2345,3,42);
    $filtered = array_filter($myints, "filter_values");
    print_r($filtered);
?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.