I have the following routine that generates an array for me:
$tipo = "V";
if($tipo == "V"){
$addonTypeSuccess = ["size" => 10, "option" => 'classic', "type" => "volume"];
}
$arrayAWSAgregado[] = array(
"product_alias" => 'teste',
"months" => 1,
$addonTypeSuccess
);
$arrayAWS[] = array(
"product_alias" => 'teste',
"os" => 'linux',
"months" => 1,
"addons" => $arrayAWSAgregado
);
$dataAssinatura = array(
'email' => '[email protected]',
'order_id' => 29292,
'products' => $arrayAWS
);
This generates the following array:
Array
(
[email] => [email protected]
[order_id] => 29292
[products] => Array
(
[0] => Array
(
[product_alias] => teste
[os] => linux
[months] => 1
[addons] => Array
(
[0] => Array
(
[product_alias] => teste
[months] => 1
[0] => Array
(
[size] => 10
[option] => classic
[type] => volume
)
)
)
)
)
)
I would like the array [size], [option], and [type] not to be placed inside an array. How can I do this? I wish they were at the same level as [product_alias] and [months].