首页 > Web开发 > 详细

【php】关于尾部去除和分号问题

时间:2018-09-05 08:01:55      阅读:162      评论:0      收藏:0      [点我收藏+]

One thing to remember is, if you decide to omit the closing PHP tag, then the last line of the file should be ended with semi colon. If you add the closing tag then last line doesn‘t need to end with semi colon.

<?php
echo "First line";
echo "Last line"

The above code throws error as it neither has closing tag nor semicolon endingSo it should be replaced with either of the below two

<?php
echo "First line";
echo "Last line";

or

<?php
echo "First line";
echo "Last line" ?>

 

如果需要保存尾部的换行,在?>后面添加一个空格或者换行

【php】关于尾部去除和分号问题

原文:https://www.cnblogs.com/china-flint/p/9589342.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!