I'm trying to create some PHP that will perform a calculation from two sequences of input text.
If the user enters 9,8,2 in one input, and 5,2,3 in other it will perform a calculation.
Anyway, I've gotten very close but the calculation is showing commas and I'm not sure how to get rid of these commas from the array. Any help would be greatly appreciated.
$first = $_POST['first'];
$second= $_POST['second'];
$maths = $first[0] * $second[0] + $first[0] * $second[1] + $first[0] * $second[2] + $first[0] * $second[3] + $first[0] * $second[4] + $first[0] * $second[5] + $first[1] * $second[0] + $first[1] * $second[1] + $first[1] * $second[2] + $first[1] * $second[3] + $first[1] * $second[4] + $first[1] * $second[5] + $first[2] * $second[0] + $first[2] * $second[1] + $first[2] * $second[2] + $first[2] * $second[3] + $first[2] * $second[4] + $first[2] * $second[5];
$result = "$first[0] * $second[0] + $first[0] * $second[1] + $first[0] * $second[2] + $first[0] * $second[3] + $first[0] * $second[4] + $first[0] * $second[5] + $first[1] * $second[0] + $first[1] * $second[1] + $first[1] * $second[2] + $first[1] * $second[3] + $first[1] * $second[4] + $first[1] * $second[5] + $first[2] * $second[0] + $first[2] * $second[1] + $first[2] * $second[2] + $first[2] * $second[3] + $first[2] * $second[4] + $first[2] * $second[5]";
echo "</br>";
echo "the question is $result";
echo "</br>";
echo "the result is $maths ";