I'm sending 3 arrays with all arguments equal to 1. So the output of 'd' should be 9 and 'n' also ought to be 9. Instead I get 39. Anyone knows why? This is function
<html>
<body>
<?php
function eq1($a,$b,$c)
{
$d= $a[0]*$b[1]*$c[2]+$b[0]*$c[1]*$a[2]+$c[0]*$a[1]*$b[2];
$n= $c[0]*$b[1]*$a[2]+$b[0]*$a[1]*$c[2]+$a[0]*$c[1]*$b[2];
echo $d;
echo $n;
}
?>
</body>
</html>
This is example of array definition
$a= [1,1,1]
;
$b= [1,1,1]
;
$c= [1,1,1]
;
This is calling for fuction
//calculating for cramer method
$dg=eq1($a,$b,$c);