I have two cookies and their values like this:
foreach ($_COOKIE as $key => $val) {
$piece = explode(",", $val);
$t_cost = array($piece[3]);
print_r($t_cost); //It prints Array ( [0] => 11 ) Array ( [0] => 11 )
echo $total_cost = array_sum($t_cost);
}
But it prints only one value. How can I add the both values to sum them?