2015-11-20 96 views

回答

0

這很可能是最簡單的方法。將您的包含文件更改爲包含字符串。如果該字符串已定義,請將其包含在標題中。

<php 

$script = "<script src='myfile'></script>"; 
include("header.php"); 

?> 

PHP包含文件

<html> 
<head> 
... 
// if $script is defined, include it 
<?php if(isset($script)){ echo $script; } ?> 
</head> 
相關問題