我将一些内容放入名为“index.php”的文件中,代码如下:
$put=<<<DEMO
<div id='container' style='width:100%'>
<style>
h1 {font-size:45px;}
</style>
<div id='header' style='background-color:#FFFFFF;'>
<h1 style='margin-bottom:0;margin-top:0;height:20%;float:center;'>
while($row = mysql_fetch_array($result))
{
第 108 行
<table align='left'><tr><td><img src="$row['Website_Name']/index.jpg" align='center' width='240' height='170'></td></tr></table>
<table align='center'><br><tr><td><h1>$row['Business_Name']</td></tr></table>
}
</h1></div>
</div>
DEMO;
file_put_contents("$str/index.php","$put");
但是在浏览器中运行代码时,出现错误:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in E:\Program Files\xampp\htdocs\registration.php on line 108