Source Code:
(back to article)
<?php $words = array("apple", "banana", "cherry"); $count = array_reduce($words, function($carry, $item) { return $carry + 1; }, 0); echo $count; // 3 ?>
Result:
Report an issue