Re: sending a variable variables to a function

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

 



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);

-- 
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