我正在尝试打印项目列表,并在其旁边计算数量。到目前为止,仅在图像旁边打印了数量。我也需要出现价值(即苹果)。该值确实出现了,直到我添加了“数量”。任何帮助将不胜感激。
echo "<br/><br/><br/> You are leaving on ". $_POST["departuredate"]."</p>";
echo "You are returning on ". $_POST["returndate"]."</p>";
$return= strtotime($_POST["returndate"]);
$depart = strtotime($_POST["departuredate"]);
$datediff = $return - $depart;
echo "You are going for <b> ";
$quantity=floor($datediff/(60*60*24));
echo $quantity;
echo " days";
$Yoghurt= 'Yoghurt' + $quantity;
$Apple = 'Apple' + $quantity;
$Banana = 'Banana' + $quantity;
....
$FoodList=array_unique($FoodList);
$img_path = 'empty_checkbox.gif';
if(!empty($FoodList))
{
foreach ($FoodList as $key => $value)
{
echo "<li>" . "<img src='$img_path' />" . " ". $value ."</li>";
}
echo "</ul>";
}