Codice PHP:
$int 34;
$str = (string) $int
Poi con http://it.php.net/str_pad puoi aggiungere tutti i valori che ti servono prima o dopo.