Re: blank function parameters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Giles Roadnight <giles@xxxxxxxxxxxxxx>:
> If I defined a function with 4 parameters but only pass 3 I get an
> error. Is there anyway around this?
>  
> I want to be able to set the missing parameter to a default value if it
> is not passed which works ok but How do I get rid of the error message?

Read about functions on php.net. Basically, yes: 

function someFunc($arg1, $arg2, $arg3, $arg4 = 'default') {}

-- 
Matthew Weier O'Phinney           | mailto:matthew@xxxxxxxxxx
Webmaster and IT Specialist       | http://www.garden.org
National Gardening Association    | http://www.kidsgardening.com
802-863-5251 x156                 | http://nationalgardenmonth.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux