Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Use external variable in array_filter

$foo = array_filter($bar, function($obj) use ($id) {
    if (isset($obj->foo)) {
        var_dump($id);
        if ($obj->foo == $id) return true;
    }
    return false;
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Use #external #variable
ADD COMMENT
Topic
Name
7+4 =