2017-05-31 53 views
-1

我在這一行錯誤:這條線有什麼問題? PHP的拼接錯誤

$previous_next = '<div class="previous">POPRZEDNI WPIS:<h4><a href="#">'.<?= $previous_row->title ?>.'</a></h4><br></div>'; 

的錯誤是

An uncaught Exception was encountered 

Type: ParseError 

Message: syntax error, unexpected '<' 

Filename: E:\XAMPP\htdocs\projekt2\application\models\Devloger.php 

Line Number: 68 

Backtrace: 

File: E:\XAMPP\htdocs\projekt2\application\controllers\Main.php 
Line: 9 
Function: model 

File: E:\XAMPP\htdocs\projekt2\index.php 
Line: 315 
Function: require_once 

崇高的文本甚至不能正常突出這一代碼。 但我在這裏看不到任何錯誤。 這裏有什麼問題?

+0

'<?= $ previous_row->標題?>'應該是'$ previous_row-> title'你還沒有使用'<?'裏面的PHP代碼 – splash58

+0

爲了增加以上評論;錯誤是由於你已經在php標籤內部而引發的,當你已經在一對中時,不需要再添加一組''。 – Epodax

+0

只是刪除PHP標籤 – Toxide82

回答

2

試試這個

$previous_next = '<div class="previous">POPRZEDNI WPIS:<h4><a href="#">'.$previous_row->title.'</a></h4><br></div>';