A quick question.
Is it possible to declare the callback function inline, in php? For example,
array_filter($input_array, "function($item) { $item['state'] != 0 }")
Yes, after php 5.3, you could use anonymous function.
array_filter($input_array, function($item) { return $item['state'] != 0; });
Sure it calls anonymous functions:
array_filter($input_array, function($item) {
return $item['state'] != 0;
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With