Sorry for the bad title but I couldn't figure out how to word my question and I couldn't find the answer anywhere.
Can I do this/will this work:
<p>
<?php
$x=array(1,2);
$y=array(3,4);
$z=array($x,$y); <-----will this work?
?>
</p>
Sorry for the bad title but I couldn't figure out how to word my question and I couldn't find the answer anywhere.
Can I do this/will this work:
<p>
<?php
$x=array(1,2);
$y=array(3,4);
$z=array($x,$y); <-----will this work?
?>
</p>
You are actually creating a multi dimensional array here.
$x = array(1, 2);
$y = array(3, 4);
$z = array($x, $y);
The third array will be like this after execution of above script.
$z = array(
0 => array(
0 => 1,
1 => 2
),
1 => array(
0 => 3,
1 => 4
),
) ;