-1
我正在尝试打印一个项目列表,并在其旁边的数量的计算。到目前为止,只有数量被打印在图像旁边。我需要这个值(即苹果)出现。该值确实出现,直到我添加“数量”。任何帮助将不胜感激。打印文字和PHP变量
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>";
}
从哪里'$ FoodList'来? – DontVoteMeDown
'$ Yoghurt ='Yoghurt'+ $ quantity;''+'来自JavaScript。它必须是'.' – iCode