%s , %d, etc

This is a discussion on %s , %d, etc within the PHP Language forums, part of the PHP Programming Forums category; Thanks in advance to anyone who can help. I just have a quick question - I cannot find an answer at ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-26-2008
AJ
 
Posts: n/a
Default %s , %d, etc

Thanks in advance to anyone who can help.

I just have a quick question - I cannot find an answer at php.net.

I have some define elements, for example:

define('EMAIL_GREET_MR', 'Dear Mr. %s,' . "\n\n");

define('TEXT_CITY_UNLISTED', 'If your city is not listed please
click&nbsp;<a href="%s""><u>here</u></a>');

define('PREVNEXT_TITLE_PAGE_NO', 'Page %d');

They certainly look like variables but I can find no references to them
on php.net or in my php books. I have tried to figure out where these
are declared and I'm having trouble. Could someone tell me about these
or point me to a good source of info on the topic?

I'm still learning so be kind!

Thanks again.

AJ
Reply With Quote
  #2 (permalink)  
Old 04-26-2008
Jensen Somers
 
Posts: n/a
Default Re: %s , %d, etc

Hello,

AJ wrote:
> Thanks in advance to anyone who can help.
>
> I just have a quick question - I cannot find an answer at php.net.
>
> I have some define elements, for example:
>
> define('EMAIL_GREET_MR', 'Dear Mr. %s,' . "\n\n");
>
> define('TEXT_CITY_UNLISTED', 'If your city is not listed please
> click&nbsp;<a href="%s""><u>here</u></a>');
>
> define('PREVNEXT_TITLE_PAGE_NO', 'Page %d');
>
> They certainly look like variables but I can find no references to them
> on php.net or in my php books. I have tried to figure out where these
> are declared and I'm having trouble. Could someone tell me about these
> or point me to a good source of info on the topic?
>
> I'm still learning so be kind!
>
> Thanks again.
>
> AJ


You can find some information on the "sprintf" help page at
http://www.php.net/manual/en/function.sprintf.php regarding these things.

- Jensen
Reply With Quote
  #3 (permalink)  
Old 04-28-2008
Lars Eighner
 
Posts: n/a
Default Re: %s , %d, etc

In our last episode, <yqidnWjAyK5H047VnZ2dneKdnZydnZ2d@giganews.com>, the
lovely and talented Jensen Somers broadcast on comp.lang.php:

> Hello,


> AJ wrote:
>> Thanks in advance to anyone who can help.
>>
>> I just have a quick question - I cannot find an answer at php.net.
>>
>> I have some define elements, for example:
>>
>> define('EMAIL_GREET_MR', 'Dear Mr. %s,' . "\n\n");
>>
>> define('TEXT_CITY_UNLISTED', 'If your city is not listed please
>> click&nbsp;<a href="%s""><u>here</u></a>');
>>
>> define('PREVNEXT_TITLE_PAGE_NO', 'Page %d');
>>
>> They certainly look like variables but I can find no references to them
>> on php.net or in my php books. I have tried to figure out where these
>> are declared and I'm having trouble. Could someone tell me about these
>> or point me to a good source of info on the topic?
>>
>> I'm still learning so be kind!
>>
>> Thanks again.
>>
>> AJ


> You can find some information on the "sprintf" help page at
> http://www.php.net/manual/en/function.sprintf.php regarding these things.


What is more, there is a standard C library function "sprintf," so a
sprintf-like function is found in many languages (e.g. perl) and many C
applications, and there is a unix-like command 'printf'. All are very
similar in formating. The PHP manual page looks fairly complete to me, but
if you just don't get it, you can probably find tutorials for other
languages that should give you a better idea of what is going on.

--
Lars Eighner <http://larseighner.com/> usenet@larseighner.com
Countdown: 267 days to go.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:08 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0