我尝试在我的php $ tag内运行 file_get_contents ,但它不起作用,希望您能告诉我为什么。
我需要在我的$ linkContent中包含3个内容,然后将其发送给另一个.php文档!
!但是 file_get_contents 的内容无法正确运行。
if ($content_type == '1') {
$linkcontent = "
$homepageheader
<meta property="og:url" content="http://$directory"/>
<meta property="og:image" content="$billedeurl" />
<br>
$homepage2<br>
$homepage3<br>
$homepage4<br>
$homepagefooter
";
}else{
$linkcontent = "
$homepageheader
<meta property="og:url" content="http://$directory"/>
<meta property="og:image" content="$billedeurl" />
<br>
$first = 'xxxx/2.php';
$second = 'xxxx/3.php';
$third = 'xxxx/4.php';
$array = array($first, $second, $third);
shuffle($array);
foreach($array as $el) {
file_get_contents($el);
}
;";
}
尝试使用require而不是file_get_contents。使用要求,您包含的文件将被解释为PHP文件。