+ -
当前位置:首页 → 问答吧 → 怎么将while循环里的值得取出来啊?

怎么将while循环里的值得取出来啊?

时间:2011-12-10

来源:互联网

<?php
$i=1;
while($i<=5)
  {
  $dd="";
  $dd.= "The number is " . $i . "<br />";
  $i++;
  }
  echo $dd;
?>

如下
想要的$dd变量为下面(当然不能在while循环你里输出)
还有我想知道我的$dd为什么不是我想要的结果,哪位大虾帮讲解下原因。(新人莫笑。)
The number is 1
The number is 2
The number is 3
The number is 4
The number is 5

作者: sdnngnn   发布时间: 2011-12-10

删 $dd="";

作者: helloyou0   发布时间: 2011-12-10

相关阅读 更多