Re: How can I use a function's default arguments but change one of the end ones in the list?
| From: | Daniel Brown | Date: | Fri, 06 Feb 2009 00:56:28 +0000 |
| Subject: | Re: How can I use a function's default arguments but change one of the end ones in the list? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-287779@lists.php.net to get a copy of this message | ||
On Thu, Feb 5, 2009 at 18:50, Daevid Vincent <daevid@daevid.com> wrote:
> Is there a way to use the default values of a function without
> specifying every single one until the parameter you want to modify in
> PHP5 ?
Daevid,
Check out func_get_args(): http://php.net/func_get_args
Then you can rename your sql_query() function to real_sql_query()
and create a new sql_query() as a wrapper function with
func_get_args() in place of statically-defined variables.
--
</Daniel P. Brown>
daniel.brown@parasane.net || danbrown@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Unadvertised dedicated server deals, too low to print - email me to find out!