Good Afternoon,
I am currently building a web site using PHP and MySQL; I was just wondering if anyone could answer a generic question for me.
If I have the variable:
$Array_1 = array($Element1, $Element2, $Element3);
I then assign that array to another variable
$Temp_Var = $Array_1;
$Temp_Var then becomes a multi-dimensional array, so if I want to get the value of $Array_1[0], through $Temp_Var – I need to write $Temp_Var[0][0].
I was wondering if there is a way to assign $Array_1 to $Temp_Var, and not end up with a multi-dimensional array. I know I could create $Temp_Var as an array then run a loop to push the elements of $Array_1 into $Temp_Var, but it seems like there should be a more efficient way and I’m just missing something.
Any help would be great.
Thanks…
I am currently building a web site using PHP and MySQL; I was just wondering if anyone could answer a generic question for me.
If I have the variable:
$Array_1 = array($Element1, $Element2, $Element3);
I then assign that array to another variable
$Temp_Var = $Array_1;
$Temp_Var then becomes a multi-dimensional array, so if I want to get the value of $Array_1[0], through $Temp_Var – I need to write $Temp_Var[0][0].
I was wondering if there is a way to assign $Array_1 to $Temp_Var, and not end up with a multi-dimensional array. I know I could create $Temp_Var as an array then run a loop to push the elements of $Array_1 into $Temp_Var, but it seems like there should be a more efficient way and I’m just missing something.
Any help would be great.
Thanks…