RE: [PHP] Zero Fill -> Number Format
| From: | Martin Towell | Date: | Thu, 20 Mar 2003 22:36:33 +0000 |
| Subject: | RE: [PHP] Zero Fill -> Number Format | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-140498@lists.php.net to get a copy of this message | ||
oops, sorry - try this instead
sprintf/printf("%07d", $num)
-----Original Message-----
From: Boaz Yahav [mailto:berber@netvision.net.il]
Sent: Friday, March 21, 2003 8:23 AM
To: Martin Towell; Harry.de; php-general@lists.php.net
Subject: RE: [PHP] Zero Fill -> Number Format
wouldn't this just print empty spaces before the number instead of the
needed Zeros?
-----Original Message-----
From: Martin Towell [mailto:martin.towell@world.net]
Sent: Thursday, March 20, 2003 1:11 AM
To: 'Harry.de'; php-general@lists.php.net
Subject: RE: [PHP] Zero Fill -> Number Format
sprintf/printf("%7d", $num)
-----Original Message-----
From: Harry.de [mailto:harald.mohring@gmx.de]
Sent: Thursday, March 20, 2003 10:09 AM
To: php-general@lists.php.net
Subject: [PHP] Zero Fill -> Number Format
How can I put out a Zero Fill for numbers
The result should be
$something=26;
echo $something;
e.g.
0000026
I didn't found a solution with number format. Is there any other way?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php