douxieti6851 2019-06-17 06:24
浏览 58
已采纳

php变量后无法在html链接中使用类关键字[重复]

This question already has an answer here:

I want to blink the link "view" but it says:

Parse error: syntax error, unexpected 'class' (T_CLASS) in C:\xampp\htdocs\vi_data.php on line 107

echo "<td width='150'> <a href='didata.php?id=".$diReturn- 
>diID.class="blinking""'><span> View </span> </a> </td> ";
</div>
  • 写回答

1条回答 默认 最新

  • douyujun0152 2019-06-17 06:26
    关注

    You are using concatenation in wrong way, do like below:

    echo "<td width='150'> <a href='didata.php?id=". $diReturn->diID ."' class='blinking'><span> View </span> </a> </td> ";
    

    Sample output (just for understanding purpose):- https://3v4l.org/MsjTk

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?