Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env php
- <?php
- # for PHP 5.3 use "Closure"
- $strtoupper = function($s) { return strtoupper($s); };
- $fruits = array('apple', 'orange', 'cherry');
- $stars = array('sun', 'moon', 'earch');
- echo implode('-', array_map($strtoupper, $fruits)) . "\r\n"; // APPLE-ORANGE-CHERRY
- echo implode('-', array_map($strtoupper, $stars)) . "\r\n"; // SUN-MOON-EARCH
Add Comment
Please, Sign In to add comment