Re: Help! PRINTF Function
| From: | Roman Neuhauser | Date: | Mon, 06 Nov 2006 16:40:47 +0000 |
| Subject: | Re: Help! PRINTF Function | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-244258@lists.php.net to get a copy of this message | ||
# ngoc.truong-torche@vd.ch / 2006-11-06 12:46:14 +0100:
>
> Hello,
>
> The following examples don't work
>
> printf("[%10s]\n", $s); // justification ? droite avec des espaces
> printf("[%-10s]\n", $s); // justification ? gauche avec des espaces
>
> but this one:
>
> printf("[%'#10s]\n", $s); // utilisation du caract?re personnalisé de
> séparation '#'
>
> is ok (with any separator)
it works:
roman@dagan ~ 1003:0 > php tmp/scratch
[monkey]
[ monkey]
[monkey ]
[0000monkey]
[####monkey]
[many monke]
roman@dagan ~ 1004:0 >
> Is it related to French characters set I used for displaying my page ?
No, it's related to your browser replacing multiple whitespace
characters with a single horizontal space.
--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991