2017-05-31 56 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>';