* "Ryan A" <[EMAIL PROTECTED]>:
> This is the code I am using to display a persons age from the mysql db:
>
> $day1=strtotime($age);
> $day2 = strtotime(date("Y-m-d"));
Just to be pedantic... just use time() for the above statement; no
reason to do extra work here. (date() will actually call time(
> Use floor() instead of round(). Using the round() function will round
> anyone whose age is above 16.5 to 17, while floor() always rounds down.
Thanks mate...silly me.
Cheers,
Ryan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hey,
On 7/3/2005 2:12:35 AM, Colin Ross ([EMAIL PROTECTED]) wrote:
> and for completeness of the topic, ceil() will round fractions up.
> i.e.
>
> ceil(16.1) = 17
> ceil(16.0) = 16
>
> I think the Credit Card Industry using ceil() alot ;P
>
Well, either i am dumb or that is pretty go
>
> I think the Credit Card Industry using ceil() alot ;P
>
HAHAHAHAHAHAHAHAHAHAah.*sigh*
--
PHP rocks!
"Knowledge is Power. Power Corrupts. Go to school, become evil"
Disclaimer: Any disclaimer attached to this message may be ignored.
However, I must say that the ENTIRE co
and for completeness of the topic, ceil() will round fractions up.
i.e.
ceil(16.1) = 17
ceil(16.0) = 16
I think the Credit Card Industry using ceil() alot ;P
On 7/2/05, Jasper Bryant-Greene <[EMAIL PROTECTED]> wrote:
>
> Ryan A wrote:
> > Hey guys,
> > This is the code I am using to
Ryan A wrote:
Hey guys,
This is the code I am using to display a persons age from the mysql db:
$day1=strtotime($age);
$day2 = strtotime(date("Y-m-d"));
$dif_s = ($day2-$day1);
$dif_d = ($dif_s/60/60/24);
$age = round(($dif_d/365.24));
but when someone entered their birth day($age) as 1988-07-0
6 matches
Mail list logo