Re: [PHP] Function with Optional Arguments

2004-07-21 Thread Justin Patrin
On Wed, 21 Jul 2004 13:39:32 -0500, Alex Hogan <[EMAIL PROTECTED]> wrote: > Hi All, > > How do I write a function with optional arguments? Is it possible in > php? > > function myfunc($First, $Second,[$Third, $Fourth]){ > some stuff here > } > Give them a default value and they become opti

Re: [PHP] Function with Optional Arguments

2004-07-21 Thread Frank Munch
You can use default arguments: func foo($first, $second=2, $third=3 etc. or look at function func_num_args(... HIH Frank At 01:39 AM 7/22/2004, Alex Hogan wrote: Hi All, How do I write a function with optional arguments? Is it possible in php? function myfunc($First, $Second,[$Third, $Fourth]){

Re: [PHP] Function with Optional Arguments

2004-07-21 Thread Marek Kilimajer
Alex Hogan wrote: Hi All, How do I write a function with optional arguments? Is it possible in php? function myfunc($First, $Second,[$Third, $Fourth]){ some stuff here } Yes, it's in the manual, I recomend you read it first. function myfunc($First, $Second, $Third = 'third arguments defa

Re: [PHP] Function with Optional Arguments

2004-07-21 Thread Geethanandh Kandasamy
check this link simple example http://perl.about.com/library/weekly/aa121002c.htm On Wed, 21 Jul 2004 13:39:32 -0500, Alex Hogan <[EMAIL PROTECTED]> wrote: > Hi All, > > How do I write a function with optional arguments? Is it possible in > php? > > function myfunc($First, $Second,[$Third, $F