note 44646 added to function.sprintf
| From: | Gkeeper80 at osu1 dot php dot net | Date: | Wed, 11 Aug 2004 22:58:20 +0000 |
| Subject: | note 44646 added to function.sprintf | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-74503@lists.php.net to get a copy of this message | ||
When using sprintf with padding, it's important to note that specifying the length of your
padding does not restrict the length of your output.
For example:
$var = 'test';
$output sprintf("%03s", $var);
print $output;
Produces:
test
NOT:
est
This may seem intuitive for working with numbers, but not neccesarily when working with strings.
----
Manual Page -- http://www.php.net/manual/en/function.sprintf.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+44646
Delete -- http://master.php.net/manage/user-notes.php?action=delete+44646&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+44646&report=yes
Search -- http://master.php.net/manage/user-notes.php