2016-11-28 121 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>'; 

使用「,而不是」