note 43001 added to function.mktime

From: Date: Sun, 06 Jun 2004 15:42:12 +0000
Subject: note 43001 added to function.mktime
Groups: php.notes 
Request: Send a blank email to php-notes+get-70464@lists.php.net to get a copy of this message
<?php // I used the following code to calculate How long i lived with my wife :-) // hope this help somebody want to calculate the same thing ! // some of the chars in traditional chinese. $WeddingYear = 2003; $WeddingMonth = 6; $WeddingDay = 6; $CurrentTime = strtotime( "now" ); $yeardiff = 0; while($CurrentTime >= mktime(0, 0, 0, $WeddingMonth, $WeddingDay, $WeddingYear + 1)) { $yeardiff++; $WeddingYear++; } $monthdiff = 0; while($CurrentTime >= mktime(0, 0, 0, $WeddingMonth + 1, $WeddingDay, $WeddingYear)) { $monthdiff++; $WeddingMonth++; } $daydiff = 0; while($CurrentTime >= mktime(0, 0, 0, $WeddingMonth, $WeddingDay + 1, $WeddingYear)) { $daydiff++; $WeddingDay++; } $yearString = ""; if ($yeardiff <> 0) $yearString = "<font color=red>$yeardiff</font> ¦~"; $monthString = ""; if ($monthdiff <> 0) $monthString = "<font color=red>$monthdiff</font> ­Ó¤ë"; $dayString = ""; if ($daydiff <> 0) $dayString = "<font color=red>$daydiff</font> ¤é"; echo "<a href='http://www.yourdomain.com/wedding/'>§Ú¤w¸gµ²±B $yearString$monthString$dayString" . "°Õ !</a>"; ?> ---- Manual Page -- http://www.php.net/manual/en/function.mktime.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+43001 Delete -- http://master.php.net/manage/user-notes.php?action=delete+43001&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+43001&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#70464) next »