Home >Backend Development >PHP Tutorial >Accumulation of PHP learning precautions
1. About PHP tags
When I was learning PHP code, I looked at the files written by others. Many of them only had PHP start tags<?
, but no end tags. It turns out that this is the recommended way of writing in the official PHP manual.
If the file content is pure PHP code, it is best to remove the PHP closing tag at the end of the file. This can prevent php from accidentally adding spaces or newlines after the end tag, which will cause php to start outputting these spaces, and there is no intention to output them in the script at this time. The following files:
<code><?php echo "Hello world"; // ... more code echo "Last statement"; // 脚本至此结束,并无 PHP 结束标记 </code>').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });
The above has introduced the accumulation of precautions for learning PHP, including aspects of content. I hope it will be helpful to friends who are interested in PHP tutorials.