I am creating the CDT function but after performing the validation of a condition with the if I assign the data to the variable $ vector that are a string of characters that I have this error I have three modules, form, operation, functions
function CDT($montoCDT, $nombrec, $email, $time) {
if ($montoCDT >= 1000000) {
if ($time == 1) {
$vector = ['Ganancia equivale a'] = "el 3.5%"; //in this line the error is marked
} elseif ($time == 2) {
$vector = ['Ganancia equivale a'] = "el 4.0%";
} elseif ($time == 3) {
$vector = ['Ganancia equivale a'] = "el 4.8%";
}
} else {
echo "No se puede abrir el CDT debe ingresar un monto mayor o igual a $1.000.000";
}
return $vector;
}
the function should initially validate that $montoCDT
is May to 1,000,000 and if so, compare if it is 1 to 3 months to get a message if it is 3 to 6 other and if it is 6 to 12 other, finally if the value is less than 1,000,000 show a message that says you can not open the CDT