This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Call callback function for every element of an array and provide some extra information for each element | |
* | |
* @param array $array | |
* @param Callback/Closure $callback | |
* Callback/Closure must have 6 parameters | |
* mixed key: key of item | |
* mixed value: value of item | |
* integer counter: human readable index of item; starts with 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$config = array( | |
'fizz' => 3, | |
'buzz' => 5, | |
/* | |
'prim' => function($num) { | |
return in_array($num, array(1, 2, 3, 5, 7, 11, 13, 17, 19, 23)); | |
} | |
*/ | |
); |