str_pad worked!!! Thank you all...
César Aracena
IS / MCSE+I
Neuquén, NQN
(0299) 156-356688
(0299) 446-6621
> -Mensaje original-
> De: Clay Loveless [mailto:[EMAIL PROTECTED]]
> Enviado el: Martes, 11 de Junio de 2002 12:35 a.m.
> Para: PHP-General
> Asunto: Re: [PHP]
> Sent: Monday, June 10, 2002 11:20 PM
> To: César L. Aracena; PHP General List
> Subject: Re: [PHP] Adding zeros in front
>
> I think certain types of INT fields (not sure which ones) zero fill
the
> number to the field length... you should read up on the col types, and
> maybe
&g
Try this:
echo str_pad($row[main_group],4,"0",STR_PAD_LEFT)."/".$row[sub_group];
-Clay
> From: César L. Aracena <[EMAIL PROTECTED]>
> Date: Tue, 11 Jun 2002 00:11:30 -0300
> To: "PHP General List" <[EMAIL PROTECTED]>
> Subject: [PHP] Adding zeros in front
>
> Hi all,
>
> Does anyone remembers
$num2 = sprintf("%4d", $num);
the "d" might have to be something else, can't remember
-Original Message-
From: Justin French [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 11, 2002 1:20 PM
To: César L. Aracena; PHP General List
Subject: Re: [PHP] Adding zeros i
I think certain types of INT fields (not sure which ones) zero fill the
number to the field length... you should read up on the col types, and maybe
change it over. Maybe do a search on "zerofill" / "zero fill".
Anyhoo, to solve your immediate problem, you could check the length of
$row[main_gro
5 matches
Mail list logo