3
I have the arrays:
$tamanho = ['P', 'M', 'G'];
$quantidade = [1, 3, 5];
The end result would have to stay that way:
$final = [
["tamanho" => 'P', "quantidade" => 1],
["tamanho" => 'M', "quantidade" => 3],
["tamanho" => 'G', "quantidade" => 5]
];
I thought I’d use the array_merge
, but he returns it to me:
{"P":"1","M":"3","G":5}
And I need the "size" and "quantity" indexes, because I’m going to use a foreach
to enter this data into the database, then I need to specify the type of data.