Re: printf function
| From: | Carroll Barrett | Date: | Mon, 26 Jun 2000 15:24:52 +0000 |
| Subject: | Re: printf function | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-3130@lists.php.net to get a copy of this message | ||
Chris,
I'm not exactly sure what you are asking. If I use the code you
posted, I get the result you seem to want.
If you want printf() to directly format the date and time, I
don't think that printf() has a format to handle that directly.
You will have to pre-format the date and time just as you did in
your post.
Regards,
Carroll Barrett
-----Original Message-----
From: Chris Sano <sano@mail.rit.edu>
To: PHP List <php-general@lists.php.net>
Date: Sunday, June 25, 2000 1:27 AM
Subject: [PHP-GENERAL] printf function
Got another scenario..
$tDate = date("m.d.Y");
$tTime = date("h:i a");
trying to do this (just a snippet)
printf("<br><div class=\"small\">posted by %s on %s at
%s</div>\n", $name,
$tDate, $tTime);
tDate: 06.25.2000
tTime: 02:04 am
While I understand %s represents a string variable, my question
is HOW do I
set this printf function so that it will read $tDate and $tTime
correctly?
I tried: printf("<br><div class ... posted by %s on $tDate,
$tTime\n");
I know this works with echo, but want to find the answer, if
there is one,
to this printf function.
Thanks!
Chris
___________________________
got sano? (new design!)
http://www.rit.edu/~cms0670