Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/string/5.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 将端点头标记作为目标,以便在其前面插入样式表_Php_String_Replace_Insert_Vbulletin - Fatal编程技术网

Php 将端点头标记作为目标,以便在其前面插入样式表

Php 将端点头标记作为目标,以便在其前面插入样式表,php,string,replace,insert,vbulletin,Php,String,Replace,Insert,Vbulletin,我试图在页面的标题部分添加一些内容,问题是我使用了cms(vBulletin),所以我必须通过插件来完成。插件在页面的最末端(在结束html之后)钩住页面,因此如果我的插件是 echo('<link rel="stylesheet" href="style.css">'); echo(“”); 它的结局就像 </html><link rel="stylesheet" href="style.css"> 我是否可以将标记作为目标并在其前面插入样式表 我

我试图在页面的标题部分添加一些内容,问题是我使用了cms(vBulletin),所以我必须通过插件来完成。插件在页面的最末端(在结束html之后)钩住页面,因此如果我的插件是

echo('<link rel="stylesheet" href="style.css">');
echo(“”);
它的结局就像

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

我是否可以将
标记作为目标并在其前面插入样式表

我试过了

$string = "</head>";
$string = str_replace("</head>", "<link rel="stylesheet" href="style.css"></head>", $string);
$string=”“;
$string=str_replace(“,”,$string);
但这没有效果


如果我问得不对,很抱歉,但我希望有人理解我的意思。

你的插件就是问题所在。检查以下答案: