-1
Save Galera, I’m looking for data that is in a multidimensional array and store the data in each variable to simulate spending and flights.
I cannot take data from the array and add it to the variable.
<?php
$ar = 'A220-100';
$distancia = 3000;
$viagens = 3;
$avioes = [
'A220-100' => array('Aeronave'=>'A220-100', 'Fabricante'=>'Airbus', 'Ano'=> 2016, 'Assentos'=> 133, 'Carga'=> 13.3, 'Velocidade'=>850, 'Alcance'=>4075, 'Consumo'=>2.85, 'Desgaste'=>1.3, 'Preco'=>52.500000),
'737-500'=> array('Aeronave'=>'737-500', 'Fabricante'=>'Boeing', 'Ano'=> 1990, 'Assentos'=> 132, 'Carga'=> 15.2, 'Velocidade'=>786, 'Alcance'=>4725, 'Consumo'=>3.23, 'Desgaste'=>2.3, 'Preco'=>77.500000)
];
function Calcular(){
if(distancia > $avioes['$a']['Alcance']){
echo "Aviao com alcance inferior ao destino. VAI CAIR ";
} else {
$assentos = ($avioes['$a']['Assentos'] * 2) * $viagens;
}
}
?>