Source Code:
(back to article)
<?php $numbers = [1, 2, 3, 4, 5, 6]; $evenNumbers = array_filter($numbers, function($number) { return ($number % 2 == 0); }); print_r($evenNumbers); ?>
Result:
Report an issue