|
Posted by Henk verhoeven on 09/09/07 21:01
Sam Waller wrote:
> I'm trying do do something like this:
>
> $a = array();
> func($a);
> printf("array size in main = %d\r\n", count($a));
>
> /////////////////////////////////////
>
>
> function func($_a) {
> array_push($_a, 22);
> printf("array size in func = %d\r\n", count($_a));
> }
>
>
> This prints:
> array size in main = 0
> array size in func = 1
>
> It looks like the data is no longer available in the calling function. Is there a way to get this to
> work so that I have the computed array available in the calling function?
function func(&$_a) {
Greetings,
Henk.
Navigation:
[Reply to this message]
|