<?php
function caracter_alante($cadena, $num_lugares, $caracter){
settype($cadena, "string");
while (strlen($cadena)<$num_lugares){
$cadena = $caracter.$cadena;
}
return $cadena;
}
@$numero=$_POST['numero'];
print '<h1>'.caracter_alante($numero, 3, '0').'</h1>';
?>
No hay comentarios:
Publicar un comentario