Re: printf / sprintf function usage
am 18.12.2007 01:29:49 von Michael Fesser..oO(Dave)
>"Iván Sánchez Ortega"
>wrote in message news:fk6k09$blu$1@hercules.cohp1...
>> Dave wrote:
>>
>>> Can I do a similar operation with printf/sprintf in PHP?
>>
>> Yes.
>>
>> RTFM on sprintf and printf: http://php.net/printf ; http://php.net/sprintf
>
>I did, read the manual before posting. There is nothing mentioning the usage
>I have described in my original post.
There is.
>Note question was, whether I could use
>%%s in the first instance of sprintf and than use the resulting %s literal
>as a placeholder to the second printf.
From the manual:
| Each conversion specification consists of a percent sign (%), followed
| by one or more of these elements, in order:
| ...
| * A type specifier that says what type the argument data should be
| treated as. Possible types:
| * % - a literal percent character. No argument is required.
| ...
That's it. It describes how to get a literal % in the result string,
which is what you want.
Micha