<?php
$sum = 12;//小宠物当前的饥饿程度
echo "我饿啦:-(";
echo "<br />";
while($sum < 100){
echo "现在体力:" . $sum;
//小宠物的饥饿程度到100,表示小宠物吃饱啦,不用继续喂了,没吃饱继续喂食
$num = rand(1,20);//随机数
$sum = $sum + $num; //小宠物吃小面包
echo "我还没吃饱呢!";
echo "<br />";
echo "体力加了:".$num;
echo "现在体力:".$sum;
}
echo "终于吃饱啦^_^";
?>
$sum = 12;//小宠物当前的饥饿程度
echo "我饿啦:-(";
echo "<br />";
while($sum < 100){
echo "现在体力:" . $sum;
//小宠物的饥饿程度到100,表示小宠物吃饱啦,不用继续喂了,没吃饱继续喂食
$num = rand(1,20);//随机数
$sum = $sum + $num; //小宠物吃小面包
echo "我还没吃饱呢!";
echo "<br />";
echo "体力加了:".$num;
echo "现在体力:".$sum;
}
echo "终于吃饱啦^_^";
?>
2017-04-12
<?php
$string1 = <<<ooo
德玛西亚万岁!
ooo;
echo $string1;
?>
$string1 = <<<ooo
德玛西亚万岁!
ooo;
echo $string1;
?>
2017-04-12
<?php
$string1 = <<<ooo
德玛西亚万岁!;
ooo;
echo $string1;
?>
$string1 = <<<ooo
德玛西亚万岁!;
ooo;
echo $string1;
?>
2017-04-12