1
Good evening, everyone. I’m stuck in an impasse I can’t resolve. I need to return 11 times $tot_formatado
which corresponds to exactly once for each parceling rate present within the array.
If you look at the $tot_formatado
, put there $array[0]
that returns me the price for the $array[0]
which corresponds to the $parc_two
that is of 0.055.
You need to return the 11 values each for each input of the array used for the calculation. Example at the bottom.
function parcelamento ($valor){
$taxa_intermediacao = 0.064; // porcentagem
$taxa_processamento = 0.60; // monetário
$array = array (
$parc_two => 0.055, // porcentagem
$parc_tree => 0.060,
$parc_four => 0.065,
$parc_five => 0.075,
$parc_six => 0.085,
$parc_seven => 0.095,
$parc_eight => 0.105,
$parc_nine => 0.115,
$parc_ten => 0.125,
$parc_eleven => 0.130,
$parc_twelve => 0.135
);
$tot_formatado = number_format ( ( $valor - ( $valor * ( $array[0] + $taxa_intermediacao ) ) - 0.60 ), 2 );
return $tot_formatado;
}
parcelamento($valor);
I think this has some relationship with loop and arrays but I don’t know exactly how to do.