-5
PHP新手。有一個問題「解析錯誤:語法錯誤,意外T_CONSTANT_ENCAPSED_STRING」php解析錯誤:語法錯誤,意外T_CONSTANT_ENCAPSED_STRING
下面是代碼:
<?php
$moreLink = '';
if ($data->node_type == "product_book") :
$path = str_replace(' ', '-', strtolower($data->node_title));
$moreLink = '<a href="/books/'.$path'">Read more > </a>';
else :
$path = drupal_get_path_alias('node/' . $data->nid);
$moreLink = '<a href="/'.$path.'">Read more > </a>';
endif;
return $moreLink;
?>
任何幫助將不勝感激。謝謝。 -Matt
@JohnConde其實參考的問題不包括此特定錯誤(用'T_CONSTANT_ENCAPSED_STRING') – h2ooooooo
@ h2ooooooo真的嗎?我很驚訝。也許我們需要添加這個問題呢?或者找到另一個成爲它的標準答案? –
@JohnConde從技術上講,您可以單擊[解析錯誤:語法錯誤,意外的T_XXX](http://stackoverflow.com/questions/12769982/reference-what-does-this-error-mean-in-php/12770089/#12770089 ),然後[PHP解析/語法錯誤;和如何解決它們?](http://stackoverflow.com/q/18050071/367456),然後[意外的T_CONSTANT_AND_ENCAPSED](http://stackoverflow.com/questions/18050071/php-parse-syntax-errors-and - 如何到解決,他們/ 18092288#18092288)。也許我們應該把這個添加到參考問題中。 – h2ooooooo