我正在编写2003年编写的一本较旧的php mysql书.作者使用include()函数通过包含header.inc,footer.inc,main.inc文件等来构造html页面.现在我发现这不是在我从服务器收到很多警告后,允许在默认的ini设置中(allow_url_include设置为Off).
我还注意到你可以使用包含括号的include.我试过这个并且它可以工作,我没有收到任何错误消息或警告.两者有什么不同?也就是说,include()与include不同?
我尝试并试图让这个代码工作,并继续提出zilch.所以我决定尝试使用"for loops"而不是它首先尝试.有人能告诉我为什么这段代码不好?
<?php
$x = $y = 10;
while ($x < 100) {
while ($y < 100) {
$num = $x * $y;
$numstr = strval($num);
if ($numstr == strrev($numstr)) {
$pals[] = $numstr;
}
$y++;
}
$x++;
}
?>
Run Code Online (Sandbox Code Playgroud)