Re: sprintf does not format.
| From: | John McKown | Date: | Mon, 11 Sep 2000 19:46:03 +0000 |
| Subject: | Re: sprintf does not format. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-16223@lists.php.net to get a copy of this message | ||
On Mon, 11 Sep 2000, Michel Sabatino wrote:
> I cannot get the format I want.
>
> <?
>
> $text = sprintf("%25s%25s", "Text one", "Text two");
> print $text;
>
> ?>
>
> I just get :
>
> Text oneText two
>
Space characters are not significant in HTML (usually), You could do
something like:
print '<pre>';
print sprintf("%25s%25s","Text one","Text two");
print '</pre>';
or
print str_replace(" ","",sprintf(...));
The second one replaces a space characters with the hex encoded version.