11-28-2009, 04:51 AM
|
#9 (permalink)
|
|
The Addict
Join Date: May 2009
Posts: 287
Thanks: 5
|
You can always do this.
PHP Code:
function my_funct($parm1 = '', $parm2 = '') {
}
Where the default value is assigned to the argument and overwritten by the function call.
PHP Code:
function my_funct($first = 'John', $last = 'Doe') { echo $first . ' ' . $last; }
// Just a note, the optional arguments are best // added last in the order, otherwise you will // start to get syntax/logic errors.
// Adam Doe my_funct('Adam');
|
|
|
|