note 65328 deleted from function.getdate by bobby

From: Date: Fri, 08 Sep 2006 15:02:24 +0000
Subject: note 65328 deleted from function.getdate by bobby
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-116922@lists.php.net to get a copy of this message
Note Submitter: king_of_t3rrors at hotmail dot com ---- The function below is also wrong :) This one is right ( I promise ): { $today = getdate() ; $datebits=explode('-',$date); $year = intval($datebits[strpos($formato, 'y')]); $mon = intval($datebits[strpos($formato, 'm')]); $day = intval($datebits[strpos($formato, 'd')]); $y=0; $m=0; if ( $today['year'] > $year ) { $y=1 ; } if ( $today['mon'] > $mon ) { $m=1; } if ( $y==1 || $m==1 ) { return true; //past date } if ( $today['year'] == $year ) { if ( $today['mon'] > $mon ) { return true; //past date } if ( $today['mon']==$mon ) { if ( $today['mday'] > $day ) { return true; //past date } } } return false; }

« previous php.notes (#116922) next »