- var_dump: documentation ( source)
- explode: documentation ( source)
- array_fill: documentation ( source)
<?php
function explodeDeluxe($string, $nrParts)
{
return explode(' ', $string, $nrParts) + array_fill(0, $nrParts, null);
}
var_dump(explodeDeluxe('a b c', 2));