note 71617 added to function.date

From: Date: Thu, 07 Dec 2006 22:34:50 +0000
Subject: note 71617 added to function.date
Groups: php.notes 
Request: Send a blank email to php-notes+get-120413@lists.php.net to get a copy of this message
If you get a date from a form, here's a quick way to determine if the date is valid (i.e, make sure the user didn't enter February 31 or other invalid date) <? function validateDate($vmonth, $vday, $vyear){ $vtstamp = mktime(0,0,0,$vmonth,1,$vyear); $daysinmonth = date("t", $vtstamp); if ($vday <= $daysinmonth){ return TRUE; } else{ return FALSE; } } ?> ---- Server IP: 66.163.161.117 Probable Submitter: 209.175.79.120 (proxied: 127.0.0.1) ---- Manual Page -- http://www.php.net/manual/en/function.date.php Edit -- https://master.php.net/note/edit/71617 Del: integrated -- https://master.php.net/note/delete/71617/integrated Del: useless -- https://master.php.net/note/delete/71617/useless Del: bad code -- https://master.php.net/note/delete/71617/bad+code Del: spam -- https://master.php.net/note/delete/71617/spam Del: non-english -- https://master.php.net/note/delete/71617/non-english Del: in docs -- https://master.php.net/note/delete/71617/in+docs Del: other reasons-- https://master.php.net/note/delete/71617 Reject -- https://master.php.net/note/reject/71617 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#120413) next »