Adding zeros in front
| From: | César L . Aracena | Date: | Tue, 11 Jun 2002 03:11:30 +0000 |
| Subject: | Adding zeros in front | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-101493@lists.php.net to get a copy of this message | ||
Hi all,
Does anyone remembers how to add zeros in front of a result number given
by a query to MySQL and returned as an array, so it always shows a 4
digit number? I have:
[snip]
echo $row[main_group]."/".$row[sub_group];
[snip]
but throws out:
1/0
2/0
3/0
instead of:
0001/0
0002/0
0003/0
which it should. Thanks in advance,
Cesar Aracena <mailto:webmaster@icaam.com.ar>
CE / MCSE+I
Neuquen, Argentina
+54.299.6356688
+54.299.4466621