Re: [PHP] assigning an array to a array

2001-01-27 Thread Brian Clark


Hello Jimmy, 

(JB == "Jimmy Bäckström") [EMAIL PROTECTED] detected:

JB> $arr2[0] = $arr1[0];
JB> $arr2[1] = $arr1[1];

What is wrong with this?

$arr2 = $arr1;

Works fine for me.

-Brian



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] assigning an array to a array

2001-01-27 Thread Jimmy Bäckström

Yo!
I was wondering if it is possible to assign an array another array, I mean like this:
$arr1 = array(1, 2, 3, 4, 5);
$arr2 = array()
$arr2[0] = $arr1;

so that the element of $arr2 contains $arr1 like:
$arr2[0][0] == 1
I've tried this, but it does not work. Does anyone have any ideas how this could be 
accomplished without me not having to do like this:
$arr2[0] = $arr1[0];
$arr2[1] = $arr1[1];
etc, etc...

/Broder