You are here: Re: printf / sprintf function usage « PHP Programming Language « IT news, forums, messages
Re: printf / sprintf function usage

Posted by Michael Fesser on 12/18/07 00:29

..oO(Dave)

>"Iván Sánchez Ortega" <ivansanchez-alg@rroba-escomposlinux.-.punto.-.org>
>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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация