2016-11-28 60 views
-1

我有以下代码。Php文件不能读取css类名

echo "<table> 
<tr> 
    <td class="tablehead">Name 
    </td>  
    <td class="tablehead">Email 
    </td> 
    <td class="tablehead">Comment 
    </td> 
</tr>"; 

和相应的代码在链接的css文件中将tablehead类的内容变成彩色背景。在浏览器上运行它会返回这个错误。

Parse error: syntax error, unexpected 'tablehead' (T_STRING), expecting ',' or ';' in C:\xampp\htdocs\index.php on line 110. (line 110 is line 3 of this code pasted here.)

为什么?我该怎么办?

+0

逃生引号。http://stackoverflow.com/questions/7999148/escaping-quotation-marks-in-php – Roberrrt

回答

0
echo '<table> 
<tr> 
    <td class="tablehead">Name 
    </td>  
    <td class="tablehead">Email 
    </td> 
    <td class="tablehead">Comment 
    </td> 
</tr>'; 

使用“,而不是”