我有这个简单的循环:
for ($user = 1; $user <= 219; $user++)
{
echo "Yo <br />";
$pos = 1;
echo "Set pos to $pos <br />";
do
{
echo "Doing user $user , $pos <br />";
$pos++;
}
while ($pos <= 8);
echo "Done user $user , $pos <br /><br ";
}
当我运行它时,只有第一次迭代才会回显第一个“哟”。对于从 2 到 219 的每次迭代,输出从 开始Set pos to $pos
。样本:
Yo
Set pos to 1
Done user 1 , 9
Set pos to 1
Done user 2 , 9
Set pos to 1
Done user 3 , 9
Set pos to 1
Done user 4 , 9
Set pos to 1
Done user 5 , 9
这个声明发生了什么:
echo "Yo <br />";
为什么它只在第一次迭代中执行,而不在其他任何迭代中执行?