Question with undefined PHP function

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
lhua059
Forum Newbie
Posts: 6
Joined: Fri Apr 14, 2006 11:23 pm

Question with undefined PHP function

Post by lhua059 »

hi there, in my php program i have define a functin called extracDate(), but when i run my program ,its said that the function hasn't been defined..can any one tell me why ? cheers

Code: Select all

extractDate( );

			function extractDate(){
				foreach ($DATE as $Selected_Date){
					$Date_Selected=array();

					if($Selected_Date==""){
						echo "You should select at least one day for your booking";
					}
					if($Selected_Date=="day1"){
						$Date_Selected[]=$preferDATE["day1"];
					}
					if($Selected_Date=="day2"){
						$Date_Selected[]=$preferDATE["day2"];
					}
					if($Selected_Date=="day3"){
						$Date_Selected[]=$preferDATE["day3"];
					}
					if($Selected_Date=="day4"){
						$Date_Selected[]=$preferDATE["day4"];
					}
					if($Selected_Date=="day5"){
						$Date_Selected[]=$preferDATE["day5"];
					}
				}

				echo count($Date_Selected);

			}
Zythan
Forum Newbie
Posts: 16
Joined: Wed Apr 12, 2006 3:13 am

Re: Question with undefined PHP function

Post by Zythan »

Hello,

May I ask you what you are checking, is it the item from a dropdown list or is the user selecting a radio button ?

TIA

Zythan
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

I assume this isn't inside a class?

Is that code you posted above the actual code or has it been modified so it can be posted here?

Might be a good idea to post us the original code... don't worry if it's long, it doesn't put me off if I know what I'm looking for :)
Post Reply