Morning,
I have a csv file which i need to perform calculation on that.
For instance, i have already split the string of the user into an array which is assign as follows:
[0] = Head
[1]= *
{2]=SubHead
array [1] [3] [5] ....will be Maths operators.
I want to retrieve all the values of the column Head and column SubHead in the csv and after that multiply it like:
Row 1 of Head multiply by Row 1 of Subhead
Row 2 of Head multiply by Row 2 of Subhead
Continue till the end of row_length.
I managed to display all the values of the two columns but having problem to do the calculation.
Can someone help?
Below is the image after running the code:

if($out[1]=="*"||$out[1]=="/"||$out[1]=="+"||$out[1]=="-"){
$out1=$out[1];
if($out1=="*"){
$first=$out[0];
$second=$out[2];
foreach ($mycsv[0] as $key => $value) {
if (strcasecmp($value, $first) == 0) {
for ($row=0; $row < $row_length; $row++) {
if ($row == 0) {
echo "<tr>";
echo "<th colspan=100%>" . $mycsv[0][$key] . "</th>";
echo "</tr>";
} else {
$yes=$mycsv[$row][$key];
echo "<td>" . $yes . "</td>";
}
}
}
if (strcasecmp($value, $second) == 0) {
for ($row=0; $row < $row_length; $row++) {
if ($row == 0) {
echo "<tr>";
echo "<th colspan=100%>" . $mycsv[0][$key] . "</th>";
echo "</tr>";
} else {
$yes2=$mycsv[$row][$key];
echo "<td>" . $yes2 . "</td>";
}
}
}
}
}
Thanks for your help.