note 61579 added to function.mktime
| From: | php-general at lists dot php dot net | Date: | Tue, 07 Feb 2006 08:07:53 +0000 |
| Subject: | note 61579 added to function.mktime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-103163@lists.php.net to get a copy of this message | ||
Here's a way to find your age. I couldn't make the other examples work, so I made this
one.
<?PHP
//Birthday in this format: year-month-day
$b_day = '1983-11-26';
//display your age to a nice round decimal using floor()
echo floor((strtotime(date("Y-m-d")) - strtotime($b_day)) / (60 * 60 * 24 * 365));
?>
I hope you guys have great luck with this one! :)
Anna Marie
----
Server IP: 64.246.30.37
Probable Submitter: 70.238.225.138
----
Manual Page -- http://www.php.net/manual/en/function.mktime.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+61579
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+61579&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+61579&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+61579&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+61579&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+61579&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+61579&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+61579&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+61579&report=yes
Search -- http://master.php.net/manage/user-notes.php