note 105553 added to function.sprintf
| From: | igniz17173 at yahoo dot com | Date: | Sat, 27 Aug 2011 01:55:58 +0000 |
| Subject: | note 105553 added to function.sprintf | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-182761@lists.php.net to get a copy of this message | ||
Regarding "space" padding specified not properly displayed in html. A Cascaded Style Sheet
property for text, "white-space:pre" can be used to display the white space padding. Known
supported version, HTML 4.0.
<?php
//The 15 monkeys are attacking the [ zoo]!
$format = 'The %d monkeys are attacking the [%10s]!';
echo "<p style=\"white-space:pre\">" . sprintf($format, 15,
'zoo') . "</p>";
?>
Replacing the "space" with HTML escape character " " is still the
safest. Just in case of unsupported CSS.
----
Server IP: 124.217.228.174
Probable Submitter: 118.100.243.86
----
Manual Page -- http://www.php.net/manual/en/function.sprintf.php
Edit -- https://master.php.net/note/edit/105553
Del: integrated -- https://master.php.net/note/delete/105553/integrated
Del: useless -- https://master.php.net/note/delete/105553/useless
Del: bad code -- https://master.php.net/note/delete/105553/bad+code
Del: spam -- https://master.php.net/note/delete/105553/spam
Del: non-english -- https://master.php.net/note/delete/105553/non-english
Del: in docs -- https://master.php.net/note/delete/105553/in+docs
Del: other reasons-- https://master.php.net/note/delete/105553
Reject -- https://master.php.net/note/reject/105553
Search -- https://master.php.net/manage/user-notes.php