再谈PHP开发规范问题之结束符“?>”

发表时间:2012-07-24 文章分类:PHP 阅读:248970

文章链接:http://www.webzone8.com/article/724.html
  文件格式
文件应该使用 Unicode (UTF-8) 编码保存。同时不要使用 字节序标记(BOM) 。与 UTF-16 和 UTF-32 不同,UTF-8 编码的文件不需要指明字节序,而且 字节序标记(BOM) 在PHP中会产生预期之外的输出,阻止了应用程序设置它自己的头信息。应该使用Unix 格式的行结束符(LF)。

PHP 闭合标签

PHP闭合标签“?>”在PHP中对PHP的分析器是可选的。 但是,如果使用闭合标签,任何由开发者,用户,或者FTP应用程序插入闭合标签后面的空格都有可能会引起多余的输出、php错误、之后的输出无法显示、空白页。因此,所有的php文件应该省略这个php闭合标签,并插入一段注释来标明这是文件的底部并定位这个文件在这个应用的相对路径。这样有利于你确定这个文件已经结束而不是被删节的。
不当的:
<?php
echo "Here's my code!";
?>

适当的:
<?php
echo "Here's my code!";
/* End of file myfile.php */
/* Location: ./system/modules/mymodule/myfile.php */
有趣的视频娱乐一下

原文链接:http://www.webzone8.com/article/724.html

用户评论

用户【27.150.243*****】说:This is the correct weblog for anybody who wants to search out out about this topic. You realize so much its almost arduous to argue with you (not that I actually would want匟aHa). You undoubtedly put a new spin on a topic thats been written about for years. Great stuff, just great!

用户【27.150.243*****】说:WONDERFUL Post.thanks for share..extra wait .. ?

用户【27.150.243*****】说:I wanted to jot down a brief comment to say thanks to you for all the remarkable pointers you are giving out at this site. My long internet look up has now been paid with good ideas to exchange with my partners. I would assert that many of us visitors actually are quite endowed to dwell in a superb place with very many brilliant professionals with helpful suggestions. I feel rather privileged to have come across your entire web page and look forward to tons of more cool minutes reading here. Thank you once more for everything.

用户【27.150.243*****】说:I was more than happy to seek out this web-site.I wished to thanks to your time for this excellent learn!! I positively having fun with every little little bit of it and I have you bookmarked to check out new stuff you weblog post.

用户【31.184.236*****】说:&lt;a href=&quot;http://torontoadrugstore.ru/&quot;&gt;bootleg viagra for sale in toronto&lt;/a&gt; &lt;a href=&quot;http://onlinepharmaciesacanada.ru/&quot;&gt;online pharmacies canada&lt;/a&gt; &lt;a href=&quot;http://onlinepharmacyawithoutaprescription.ru/&quot;&gt;candian no script pharmacy&lt;/a&gt; &lt;a href=&quot;http://canadianonlineapharmacy.ru/&quot;&gt;canadian pharmacy cialis&lt;/a&gt; &lt;a href=&quot;http://freecialisasamples.ru/&quot;&gt;viagra and cialis samples from pfizer&lt;/a&gt; &lt;a href=&quot;http://viagrawithoutaprescriptions.ru/&quot;&gt;buy viagra no prescription&lt;/a&gt; &lt;a href=&quot;http://onlinepharmaciesa.ru/&quot;&gt;online pharmacies canada&lt;/a&gt; &lt;a href=&quot;http://bestprice100mgaviagra.ru/&quot;&gt;pharmacy viagra prices&lt;/a&gt; &lt;a href=&quot;http://cialisa40mg.ru/&quot;&gt;cialis 20 mg&lt;/a&gt; &lt;a href=&quot;http://viagraasamples.ru/&quot;&gt;Viagra Samples&lt;/a&gt;

用户【27.150.243*****】说:Spot on with this write-up, I actually think this web site needs rather more consideration. I抣l probably be again to learn much more, thanks for that info.

用户【27.150.243*****】说:Youre so cool! I dont suppose Ive learn anything like this before. So good to find someone with some original ideas on this subject. realy thanks for beginning this up. this web site is one thing that is wanted on the web, somebody with somewhat originality. useful job for bringing something new to the web!

用户【27.150.243*****】说:I wish to show my passion for your kindness for men and women who need help with that question. Your very own commitment to passing the message across appeared to be remarkably useful and has in most cases made ladies like me to attain their goals. Your warm and friendly guideline entails a lot a person like me and far more to my office colleagues. Thanks a ton; from each one of us.

用户【27.150.245*****】说:Aw, this was a very nice post. In concept I want to put in writing like this moreover ?taking time and precise effort to make a very good article?but what can I say?I procrastinate alot and in no way seem to get something done.

用户【27.150.245*****】说:I in addition to my friends were actually reviewing the great recommendations on your web blog and at once developed a terrible suspicion I never expressed respect to the blog owner for those techniques. The young men became absolutely happy to learn all of them and have certainly been loving them. Appreciation for really being quite thoughtful and then for selecting these kinds of remarkable tips millions of individuals are really eager to learn about. Our sincere regret for not expressing appreciation to sooner.

用户【27.150.245*****】说:There are actually plenty of details like that to take into consideration. That may be a nice level to bring up. I provide the thoughts above as common inspiration but clearly there are questions like the one you deliver up the place the most important factor will be working in sincere good faith. I don?t know if finest practices have emerged around things like that, however I am certain that your job is clearly recognized as a fair game. Each girls and boys feel the affect of only a second抯 pleasure, for the remainder of their lives.

用户【27.150.245*****】说:WONDERFUL Post.thanks for share..more wait .. ?

用户【27.150.245*****】说:I intended to send you this tiny remark to be able to give thanks yet again for these great pointers you have contributed on this page. This is unbelievably open-handed of you to make unreservedly just what many of us could have advertised for an electronic book to make some profit on their own, even more so now that you could have done it in case you considered necessary. Those strategies likewise served as the easy way to fully grasp the rest have a similar passion similar to my own to figure out more and more with regard to this matter. I am sure there are some more pleasant instances in the future for those who read carefully your website.

用户【27.150.245*****】说:I抎 have to check with you here. Which is not one thing I normally do! I enjoy reading a post that may make individuals think. Additionally, thanks for permitting me to remark!

用户【27.150.245*****】说:Thank you for your entire effort on this web site. My daughter take interest in carrying out investigation and it is easy to understand why. I notice all of the dynamic mode you convey functional strategies via this blog and in addition strongly encourage response from other ones on this area plus my daughter is without question starting to learn a lot of things. Take advantage of the remaining portion of the new year. You are doing a really good job.

12345678910...21下一页

发表评论

姓名:*
邮箱:*
网站:*