PHP标记之间发生了意外的Html标记

时间:2014-04-09 16:08:52

标签: php html

我有一个.php文件,我用<!DOCTYPE html>和正确的HTML标记启动它。但是,当我创建<?php?>标签时,

<!DOCTYPE html>
<html>
<head>
在源代码中的每个php标记之后标记

以下是来源:

<!DOCTYPE html>
<html>
<head>
<title>Hello World</title>
</head>

<body>

<!DOCTYPE html>
<html>
<head>

<link href="style.css" type="text/css" rel="stylesheet" />

<!DOCTYPE html>
<html>
<head>
<article>
<p>Hi This is sample text.</p>
</article
</body>
</html>

以下是PHP源代码:

<!DOCTYPE html>
<html>
<head>
<title>Hello World</title>
</head>

<body>

<?php
include 'links.php';
echo $stylelink;
?>

<article>
<?php
include 'content.php';
echo $sample;
?>
</body>
</html>

我不知道发生了什么,每当我添加php标签时它会自动添加!doctype和html的东西。感谢您的帮助(提前)。

0 个答案:

没有答案