Pastulio Posted June 14, 2007 Share Posted June 14, 2007 So the error occurs on the last line of my function. Here is the code for my function function checkDate ($day, $month, $year, $ddMonth){ // Februari if ($month == $ddMonth[1]){ if ($day > 29){ return false; } elseif ($day == 29){ // Check if the entered year is a leapyear if ($year % 100 != 0 && ($year % 400 == 0 || $year % 4 == 0)){ return true; } else { return false; } } else { return true; } } // April if ($month == $ddMonth[3]){ if ($day > 30){ return false; } else { return true; } } // June if ($month == $ddMonth[5]){ if ($day > 30){ return false; } else { return true; } } // September if ($month == $ddMonth[8]){ if ($day > 30){ return false; } else { return true; } } // November if ($month == $ddMonth[10]){ if ($day > 30){ return false; } else { return true; } } } // This is where I get the error Now this is where I call the function: $dateValidation = checkDate ($purchaseDay, $purchaseMonth, $purchaseYear, $ddMonth); $ddMonth is an array from a global, and i've also tried to do this: function checkDate ($day, $month, $year, $ddMonth = array()){ but I keep getting this error Link to comment https://forums.phpfreaks.com/topic/55642-solved-help-plz-fatal-error-cannot-redeclare-checkdate-in/ Share on other sites More sharing options...
fert Posted June 14, 2007 Share Posted June 14, 2007 the problem is checkdate already exists http://us2.php.net/manual/en/function.checkdate.php Link to comment https://forums.phpfreaks.com/topic/55642-solved-help-plz-fatal-error-cannot-redeclare-checkdate-in/#findComment-274934 Share on other sites More sharing options...
Pastulio Posted June 14, 2007 Author Share Posted June 14, 2007 oh lol, thanks mate, didn't know that Link to comment https://forums.phpfreaks.com/topic/55642-solved-help-plz-fatal-error-cannot-redeclare-checkdate-in/#findComment-274940 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.