I usually use the array_map
function to be able to do something similar to% list comprehension of python
Something like:
$meses = function($mes)
{
return sprintf('02%s/%s', $mes, date('Y'));
}
$arrayFormatado = array_map($meses, range(1, 12));
// Retorna: array(){ '01/2015', '02/2015', ...}
But now looking at the Manual, I realized that after the first parameter the number of arrays
passed can be infinite:
array array_map ( callback $callback , array $arr1 [, array $... ] )
What is the purpose of this?