我可以使這項工作循環不起作用:雖然在製成功能
function test1(){
$count = 1;
while($count < 8){
echo "Hello world1 <br>";
$count++;
}
}
test1();
我可以做這項工作:
while($row = mysqli_fetch_array($result)){
echo "Hello world2<br>";
}
但我不能做這項工作:
function test2(){
while($row = mysqli_fetch_array($result)){
echo "Hello world3 <br>";
}
}
test2();
echo部分是其他內容的佔位符,但爲什麼test2函數不工作?
當某些功能不起作用時,99%的時間是範圍問題。 – 2014-09-23 00:18:58
「示波器問題」的含義是什麼 - 只需再多幾個字就可以了,因此我知道要搜索網絡。 – 2014-09-23 00:23:02
這個=> http://php.net/manual/en/language.variables.scope.php會解釋它。 – 2014-09-23 00:24:07