这本书'php and mysql novice to ninja'说要包含文件count.html和count.php,我必须在count.php文件的底部键入以下内容:
include 'count.html.php';
但是,这似乎不起作用,除非它只是没有 .php 的 count.html。
这本书到底对不对?我在网上找不到任何关于这种包含方式的信息。
我已经看到了两条单独的包含标签的行,例如:
include 'a.html';
include 'b.php';
对不起,狗屎格式。我以前从来没有在这个网站上发过帖子。
计数.php:
<?php
$output = '';
for ($count = 1; $count <= 10; $count++) {
$output .= $count . ' ';
}
include 'count.html.php';
?>
计数.html:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>counting to ten</title>
</head>
<body>
<p>
<?php echo $output; ?>
</p>
</body>
</html>
一只斗牛犬