Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
$items = [1, 2, 3];
$multiplier = 2;
$doubledItems = array_map(function ($item) use ($multiplier) {
return $item * $multiplier;
}, $items);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.