Page 1 of 1

quick and basic question about arrays

Posted: Tue Mar 09, 2010 3:23 am
by joppe
say you've got 2 arrays รก la $arr1 = Array();

you've added some content to both and now you want to replace one's content with the other's (so as to have 2 identical arrays)

will this work?
$arr1 = $arr2;

or do you have to first delete the content of $arr1 and then add each element of $arr2 individually?

Re: quick and basic question about arrays

Posted: Tue Mar 09, 2010 3:50 am
by iamngk
$arr1 = $arr2;
will work. it will replace your old value.

Re: quick and basic question about arrays

Posted: Tue Mar 09, 2010 4:57 am
by joppe
thanks