2 回答
TA贡献1993条经验 获得超5个赞
<?php
$main_oddddd = "";
if(isset($_POST["submit"])){
$main_odds = $_POST["total_odds"];
if(!empty($main_odds)){
$val = 0;
echo "You have selected the following games ";
foreach ($main_odds as $final_odd){
$val += $final_odd;
}
}else{
echo "You have not selected any odds";
}
$main_oddddd = count($main_odds);
echo $val;
}
?>
<?php
$main_oddddd = "";
if(isset($_POST["submit"])){
$main_odds = $_POST["total_odds"];
//echo $main_value = implode(", ", $main_odds);
$total = 0;
if(!empty($main_odds)){
echo "You have selected the following games ";
foreach ($main_odds as $final_odd){
$total = $total * $final_odd;
}
}else{
echo "You have not selected any odds";
}
$main_oddddd = count($main_odds);
echo $total;
}
?>
TA贡献1828条经验 获得超3个赞
添加循环中的所有值。
echo "You have selected the following games: ";
$total = 0;
foreach ($main_odds as $final_odd){
$total += $final_odd;
echo "<td>$final_odd</td>" ;
}
echo "<br>Total value is " . $total;
- 2 回答
- 0 关注
- 116 浏览
添加回答
举报