why not make use of the `str_pad` function? http://php.net/manual/en/function.str-pad.php