Turn error_reporting to:
error_reporting (E_ERROR | E_WARNING | E_PARSE); // that is the function to mess in the code, you can also set it within php.ini then fix your function: It cannot have more then one return (sure it can, but will break the execution on the first-come basis). If you need them all three then make yourself an array and return it: Function return_array() { .... Return Array('date'=>$date, 'time'=>$time, 'year'=>$year); } or, make those three variables global; Function return_array() { Global $realday, $month, $year; // add this line and your function will work .... Return True; // is enough } Sincerely, Maxim Maletsky Founder, Chief Developer PHPBeginner.com (Where PHP Begins) [EMAIL PROTECTED] www.phpbeginner.com > -----Original Message----- > From: Simonk [mailto:[EMAIL PROTECTED]] > Sent: Thursday, April 04, 2002 5:39 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Help with " Function " parameter > > I have programed a function for counting Date: > > function Datereturn() > { > $monthorder = Array ( 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); > $day = Date("j"); > $monthday = Date("t"); > $month = Date("n"); > $year = Date("Y"); > $current = 42 - ($monthday - $day); > if ($current > $monthorder[$month]) > { $realday = $current - $monthorder[$month]; > $month = $month + 2; > if ($month > 12) > { $year = $year + 1; > $month = $month - 12; } > } > else > { $realday = $current; > $month = $month + 1; > if ($month > 12) > { $year = $year + 1; > $month = $month - 12; } } > Return $realday; > Return $month; > Return $year; > } > > > But when I want to echo out the result, I have typed: > > Datereturn(); > echo "$year, $month, $realday"; > > Then the server return: > Undefined variable year, month, realday > > plz help! > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php