expanding on this... function func($arga, $argb, $argc='') { do_something_with_arga($arga); do_another_thing_with_argb($argb); if ($argc != '') do_somthing_with_argc($argc); }
on 1/18/02 1:19 PM, Ben Sinclair at [EMAIL PROTECTED] wrote: > You can do something like this: > > function myFunction($a = "hello", $b = "world") { } > > Both arguments are optional and have default values. This is in the > documentation. > > -- > Ben Sinclair > [EMAIL PROTECTED] > ----- Original Message ----- > From: "Malte Fucks" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Thursday, January 18, 2001 2:17 PM > Subject: [PHP] function arguments > > > Hi, how do i tell a function which arguments can be passed and which must be > passed... > > example: > function func($arga, $argb, $argc) > { > do_something_with_arga; > do_another_thing_with_argb; > and_if_argc_was_passed_do_something_with_it_too; > } > > because i dont want to pass argc if i dont need it, and to pass void arguments > like '' is annoying... > > -- mike cullerton michaelc at cullerton dot com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]