There is logical mistake. Why do you calculate everything each time the form is submitted, if you only need to calculate selected operation? Just do each calculation within the corresponding if block, like this:
if ($operation == 'Determenant Of A'){
// calculate determenant of A here
// display results here
}
elseif ($operation == 'Determenant Of B'){
// calculate determenant of B here
// display results here
}
elseif ($operation == 'Add'){
// calculate sum of 2 matrix here
// display results here
}
// etc.
In your current code, when you calculate Substruction, you mess all your temporary variables $a11 etc. and then using these modified values when calculating A * B
Also, why don't you use multi-dimensional arrays? That would simplify output, i.e.:
for($i=1;$i<=3;$i++){
echo $a[1][$i];
}