- var_export: documentation ( source)
- explode: documentation ( source)
- str_pad: documentation ( source)
<?php
$examples = [
'Sep 04-08',
'Sep 29-Oct 01',
];
$result = [];
foreach ($examples as $example) {
[$from, $to] = explode('-', $example, 2);
var_export([$from, str_pad($to, 6, $from, STR_PAD_LEFT)]);
echo "\n";
}