- array_map: documentation ( source)
- var_dump: documentation ( source)
- array_combine: documentation ( source)
- range: documentation ( source)
- str_pad: documentation ( source)
<?php
$months = range(1, 12);
$months = array_map(function ($element) {
return str_pad($element, 2, 0, STR_PAD_LEFT);
}, $months);
$months = array_combine($months, $months);
var_dump($months);