note 22848 added to function.sprintf
| From: | Andrew dot Wright at spamsux dot atnf dot csiro dot au | Date: | Tue, 02 Jul 2002 05:53:33 +0000 |
| Subject: | note 22848 added to function.sprintf | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-32492@lists.php.net to get a copy of this message | ||
To insert 30 spaces on the left of a string:
$a = "This is some text";
$b = sprintf("%30.s", $a);
To insert 30 spaces on the right of a string:
$a = "This is some text";
$b = sprintf("%-30.s", $a)."spaces before here.";
--
http://www.php.net/manual/en/function.sprintf.php
http://master.php.net/manage/user-notes.php?action=edit+22848
http://master.php.net/manage/user-notes.php?action=delete+22848
http://master.php.net/manage/user-notes.php?action=reject+22848