Hi,
Thursday, February 20, 2003, 10:52:11 PM, you wrote:
A> Hi!
A> How can I pass an array parameter by reference?
A> I tried something similar:
A> function my_function($argument) {
A> $argument[0]="test";
A> }
A> my_function(&$array);
A> echo $array[0];
A> but the echo function returns "Array".
A> Can anybody help me?
A> Thanks!
A> Andrea
Try like this
my_function(&$argument){
$argument[0] = 'test';
}
$array = array();
my_function($array);
echo $array[0];
The function declaration is what determins the reference passing.
--
regards,
Tom
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php