In my code below GST and Amount are printing properly but Discount is not printing the result. Why is Discount not printing? How can I solve this issue?
$GST = Array ( [0] => 18 );
$Amount = Array ( [0] => 25000 );
$Discount = Array ( [0] => 10 );
array_map(
function($GST, $Amount, $Discount){
echo ' GST: '.$GST.' Amount: '.$Amount.' Discount: '.$Discount.'<br>';
echo 'Discount: '.(($Amount * $Discount) / 100).' Amount After Discount: '.($Amount - (($Amount * $Discount) / 100)).'<br>';
echo 'GST: '.(($Amount - (($Amount * $Discount) / 100)) * $GST / 100).'<br>';
//return ($Amount - (($Amount * $Discount) / 100)) * $GST / 100;
},
!is_array($GST) ? [] : $GST,
!is_array($Amount) ? [] : $Amount,
!is_array($Discount) ? [] : $Discount
)
$GST = Array ( [0] => 18 );is not valid PHP