I am storing an array in a session, but I am not able to manipulate it. How do I add all the array values?
I tried this way:
$item = $_SESSION['item'];
$total = 0;
foreach($item as $x) {
$total += $x;
}
echo $total;
exit();
however, the return is:
Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\quiz_Acaro\final.php on line 70
0