Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/248.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php HTML-将两个头部标记合并为一个_Php_Html_Codeigniter 2 - Fatal编程技术网

Php HTML-将两个头部标记合并为一个

Php HTML-将两个头部标记合并为一个,php,html,codeigniter-2,Php,Html,Codeigniter 2,我正在尝试通过php include()将两个html头合并到另一个html头中,并将一个php文件(包含用于重用的头)合并到另一个html头中。代码起作用,但它会导致以下情况: <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" type="text/css" href="./css/cus

我正在尝试通过php include()将两个html头合并到另一个html头中,并将一个php文件(包含用于重用的头)合并到另一个html头中。代码起作用,但它会导致以下情况:

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">        
    <link rel="stylesheet" type="text/css" href="./css/custom-theme/jquery-ui-1.10.3.custom.min.css">
    <link href='http://fonts.googleapis.com/css?family=Noto+Sans' rel='stylesheet' type='text/css'>
    <script type="text/javascript" src="./js/jquery191.js" ></script>
    <script type="text/javascript" src="./js/jqueryui1103.js" ></script>

</head><html>
<head>
    <title>Add Employee Form</title>
    <link rel="stylesheet" type="text/css" href="./css/addform.css">
    <script type="text/javascript" src="./js/talentform.js" ></script>
    <script type="text/javascript" src="./js/form_submission.js" ></script>
</head>

添加员工表单

我认为这是违反标准的。有没有办法在不违反标准的情况下将这两个头部合并为一个?顺便说一下,如果有帮助的话,我正在使用CodeIgniter 2框架。谢谢

为什么不让php文件只包含
中的内容,然后将其包装起来?示例:echo“”;包括(1);包括(2);回声“;?到目前为止,你的代码在哪里?@DaveChen谢谢你的想法!我删除了第一个文件的头标签,然后在第二个文件的头标签内传输了include。谢谢大家!我意识到这是一个非常愚蠢的问题。对不起,我的无知。