Re: Function Error

From: Date: Tue, 04 Jul 2000 09:11:04 +0000
Subject: Re: Function Error
Groups: php.general 
Request: Send a blank email to php-general+get-4697@lists.php.net to get a copy of this message
Addressed to: "Ted Knudson" <tedk@cyberlink.com> php-general@lists.php.net ** Reply to note from "Ted Knudson" <tedk@cyberlink.com> Tue, 4 Jul 2000 03:02:00 -0500 > > I get this Error and I do not see a problem. > > Parse error: parse error, expecting `')'' in > /home/automat/public_html/ccquote/Wall-F.php3 on line 10 > > Part of the Code******** > > //Line 10 > Function CalulatePrice($Quantity[$Z], $Height[$Z]) You don't get to specify array subscripts in a function header. Try function CalculatePrice( $Quantity, $Height ) $Quantity and $Height are simple variables, not arrays. You can do the subscripting when you call it: $Price = CalculatePrice( $Quantity[ $Z ], $Height[ $Z ] ); Also, if you want it to return somehing, you need to use return in the function. function CalculatePrice( $Quantity, $Height ) { return( $Quantity * $Height ); } Rick Widmer Internet Marketing Specialists www.developersdesk.com

« previous php.general (#4697) next »