I have two arrays as below.
$e which is
Array
(
[0] => AL-Alabama
[1] => AK-Alaska
)
$c which is
Array
(
[0] => Aerospace: General
[1] => Agriculture/Forestry/Fish ing/Mining: General
)
I want to create a multidimensional array using above two single arrays. I wrote below code, but just not working.
$mat1=array(array());
foreach ($e as $ee);
{foreach ($c as $cc);
{$mat1[$ee][] = $cc;}}
It gives me an output as below.
Array
(
[0] => Array
(
)
[AK-Alaska] => Array
(
[0] => Agriculture/Forestry/Fish ing/Mining: General
)
)
whereas my ideal output should be an array with combinations stored such
(AL-Alabama,Aerospace: General), (AL-Alabama,Agriculture/Forestry/Fish ing/Mining: General) and
(AK-Alaska,Aerospace: General), (AK-Alaska,Agriculture/Forestry/Fish ing/Mining: General)
Any help will be highly appreciated.
Thanks