Can anyone help with this?
I am relativly new to PHP and am trying to use variable numbers of
parameters to functions using the func_get_arg().
However, I am unable to determine the correct syntax for passing by
reference via the variable arg list.
Trevor
/* This Works Fine */
function Foo($Index, &$TxtString)
{
$TxtString = "NewString";
}
/* However: how do you pass by reference using a variable number of
parameters */
function Foo()
{
if(func_get_arg(0) == 3)
{
/* Can you have a variable in function foo that allows access by
reference? */
$TxtString = func_get_arg(1);
$TxtString = "Second New String";
}
}
function FooTest()
{
$StringTest = 'Test';
Foo(2);
Foo(3, $StringTest);
echo ("$StringText");
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php