Re: Function with Optional Arguments

From: Date: Wed, 21 Jul 2004 19:04:22 +0000
Subject: Re: Function with Optional Arguments
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-191378@lists.php.net to get a copy of this message
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 default value', $Fourth = 'fourt arguments default value'){
    some stuff here
}

« previous php.general (#191378) next »