Ver Mensaje Individual
  #4 (permalink)  
Antiguo 23/09/2006, 05:32
Avatar de spider_boy
spider_boy
 
Fecha de Ingreso: diciembre-2003
Ubicación: Chile
Mensajes: 1.855
Antigüedad: 20 años, 4 meses
Puntos: 89
Cita:
Iniciado por the_scorpion Ver Mensaje
Hola

Código PHP:
$numero "1";
echo 
str_pad($numero6"0"STR_PAD_LEFT); 
Si bien es cierto, eso sirve, pero eso no calcula cuantas cifras existen actualmente...

A mí me había faltado algo =P...

Código PHP:
if(strlen($numero) < 6)
{
$numero str_pad($numero6-strlen($numero), "0"STR_PAD_LEFT);
echo 
$numero;

Ahí está mejor...