Hi people.
I'm doing a website, and in this site, there is a multiple form that return me three arrays.
Each of these array give me an id that I'll use in my database for getting a dimension.
So now I want to have an array for doing this request, but i'm stuck with this.
Actually I'm trying with three foreach and putting it in the table :
$dimension = [];
foreach ($hauteurs_av as $hts => $ht)
{
$dimension[] = [
'hauteur' => $ht
];
}
foreach ($largeurs_av as $lrg => $lg)
{
$dimension[] = [
'largeur' => $lg
];
}
foreach ($diametre_av as $dmt => $dm)
{
$dimension[] = [
'diametre' => $dm
];
}
But it return me 6 arrays. What I want is an array like :
array:2 [▼
0 => array:1 [▼
"hauteur" => "17"
"largeur" => "108"
"diametre" => "16"
]
1 => array:1 [▼
"hauteur" => "17"
"largeur" => "108"
"diametre" => "16"
]
]
Do you have an idea about how I could have this array ?
Thank you !