Re: How to pass a two-dimmensional array into a function?
| From: | Shi Chuanping | Date: | Thu, 26 Oct 2000 17:01:06 +0000 |
| Subject: | Re: How to pass a two-dimmensional array into a function? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-3962@lists.php.net to get a copy of this message | ||
Hi Mike,
Thanks for your reply!
My situation is that I'm using a hash table such as $aaa["apple"][1].
It looks that the key of the hash table is not recognized within the
scope of a function, and I got parsing error msg said "expect T_VALUE"
or "T_STRING" something at the line of the array is used.
Regards.
Alex Shi
> Hi Shi,
>
> if you have your two-dimensional array $my_2d_array[][] then pass it just
> to your function like this:
>
> function test( $2d_array )
> {
> ... do something
> }
>
>
> // call your function
> test( $my_2d_array );
>
> // if you want to alter the original array, then pass it by refference
> test( &$my_2d_array );
>
>
> Hope it helps.
>
> Greetinx,
> Mike
> (Germany)
>
>
> -----Ursprüngliche Nachricht-----
> Von: Shi Chuanping [mailto:chpshi@connection.com]
> Gesendet: Donnerstag, 26. Oktober 2000 07:19
> An: php-db
> Betreff: [PHP-DB] How to pass a two-dimmensional array into a function?
>
>
> I tried in different ways but all failour :((
>
> Alex
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>