Hello, looking for some insight on the behavior of arrays.

I've got an array. One of the elements of that array is another array.

If I refer to it this way, I can get at it:

while(list($this, $that) = each($first_array["second array"])) {
        # it works!
}

But let's say I want to alter the items in the second array, removing
items or sorting differently, so to preserve the original I want to
create a new array equivalent to the second array:

$new_array = $first_array["second array"]; # what's wrong with this?

while(list($this, $that) = each($new_array)) {
        # doesn't work!
}

Any ideas or pointers? I've tried:

$new_array = array ($first_array["second array"]);

but no go.

TIA,

Doug


-- 
PHP Windows 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]

Reply via email to