KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have the following code: function lower_than_10($i) { return ($i < 10); } that I can use to filter an array like this: $arr = array(7, 8, 9, 10, 11, 12, 13); $new_arr = array_filter($arr, 'lower_than_10'); How can I add arguments to lower_than_10 so that it also accepts the number to check against? Like, if I have this: function lower_than($i, $num) { return ($i < $num); } how to call it from array_filter passing 10 to $num or whatever number?
Tags (comma-separated)
Save Edits
Cancel