hi all, i'm a newbie in programming and in php too and i was wondering if anyone can help me with my array problem.
i have two set of array, example:
$name = array("peter","peter","joe");
$cars = array("ford", "gmc", "mercy");
and i would like to merge them into a multidimensional array like this
$merge = array(array($name[0], $cars[0]),array($name[1], $cars[1]),array($name[2], $cars[2]));
now, i would like keep the structure as above but i would like to do it with a native array function or foreach function.
i've tried array_merge
and array_combine
but it didn't turn out as i expected.
i've tried $arr3 = $name + $cars;
but it didn't work too
does anyone can help me on what function should i use?
many thanks
~aji