Re: sending a variable variables to a function
| From: | Jochem Maas | Date: | Tue, 08 Aug 2006 12:38:55 +0000 |
| Subject: | Re: sending a variable variables to a function | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-240308@lists.php.net to get a copy of this message | ||
Ross wrote:
> I want to send variable variables to a function but I cannot seem to get the
> syntax correct. This is what I have so far...
>
>
> function my_function ($$moule_no) {
>
> // do something with $$module_no
>
>
>
> }
>
>
> my_function ($module1)
> my_function ($module2)
> my_function ($module3)
>
function yourFunc($foo)
{
// do something with $foo
}
yourFunc($$module1);
yourFunc($$module2);
yourFunc($$module3);
// OR (shittier way)
function yourFunc($foo)
{
global $$foo;
// do something with $$foo
}
yourFunc($module1);
yourFunc($module2);
yourFunc($module3);