RE: [PHP] Zero Fill - Number Format

2003-03-20 Thread Daevid Vincent
Just an observer, but I love how you each had a different way of accomplishing this task! ;-) And Mike, looks like you have some re-writing to do now that Martin and Kevin showed you a WAY simpler (and faster) way to accomplish what you did. LOL. http://daevid.com -Original Message-

RE: [PHP] Zero Fill - Number Format

2003-03-20 Thread Boaz Yahav
wouldn't this just print empty spaces before the number instead of the needed Zeros? -Original Message- From: Martin Towell [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2003 1:11 AM To: 'Harry.de'; [EMAIL PROTECTED] Subject: RE: [PHP] Zero Fill - Number Format sprintf/printf(%7d

RE: [PHP] Zero Fill - Number Format

2003-03-20 Thread Chris Shiflett
PROTECTED] Subject: RE: [PHP] Zero Fill - Number Format sprintf/printf(%7d, $num) -Original Message- From: Harry.de [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2003 10:09 AM To: [EMAIL PROTECTED] Subject: [PHP] Zero Fill - Number Format How can I put out a Zero Fill

RE: [PHP] Zero Fill - Number Format

2003-03-20 Thread Chris Shiflett
$something = 26; $something = sprintf('%7d', $something); $something = str_replace(' ', '0', $something); echo $something; This is a bit more direct: $something = 26; echo str_pad($something, 7, '0', STR_PAD_LEFT); Chris = Become a better Web developer with the HTTP Developer's

RE: [PHP] Zero Fill - Number Format

2003-03-20 Thread Martin Towell
oops, sorry - try this instead sprintf/printf(%07d, $num) -Original Message- From: Boaz Yahav [mailto:[EMAIL PROTECTED] Sent: Friday, March 21, 2003 8:23 AM To: Martin Towell; Harry.de; [EMAIL PROTECTED] Subject: RE: [PHP] Zero Fill - Number Format wouldn't this just print empty spaces

RE: [PHP] Zero Fill - Number Format

2003-03-19 Thread Martin Towell
sprintf/printf(%7d, $num) -Original Message- From: Harry.de [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2003 10:09 AM To: [EMAIL PROTECTED] Subject: [PHP] Zero Fill - Number Format How can I put out a Zero Fill for numbers The result should be $something=26; echo $something;

RE: [PHP] Zero Fill - Number Format

2003-03-19 Thread Mike Brum
This is what I did for a dynamic zero-fill for renaming batches of files: // Get Zero Padding For New Image Names $zero_padding = strlen(count($image_array)); foreach($image_array as $temp){ $n++; $n_length = strlen($n); for($i = 0; $i ($zero_padding - $n_length); $i++){

Re: [PHP] Zero Fill - Number Format

2003-03-19 Thread Kevin Waterson
This one time, at band camp, Harry.de [EMAIL PROTECTED] wrote: How can I put out a Zero Fill for numbers The result should be $something=26; print str_pad($something, 7, 0, STR_PAD_LEFT); Kevin __ (_ \ _) )