{"id":1456,"date":"2012-04-12T15:42:46","date_gmt":"2012-04-12T07:42:46","guid":{"rendered":"http:\/\/doophp.sinaapp.com\/?p=1456"},"modified":"2013-07-10T09:23:05","modified_gmt":"2013-07-10T01:23:05","slug":"end-symbol","status":"publish","type":"post","link":"https:\/\/blog.vimge.com\/archives\/php\/end-symbol.html","title":{"rendered":"\u5e94\u8be5\u7701\u7565PHP\u95ed\u5408\u6807\u7b7e\u7684\u7406\u7531"},"content":{"rendered":"

PHP\u5b98\u65b9\u6587\u6863\u7684\u4e00\u6bb5\u8bf4\u660e\uff1a<\/p>\n

The closing tag of a PHP block at the end of a file is optional, and in some cases omitting it is helpful when using include or require, so unwanted whitespace will not occur at the end of files, and you will still be able to add headers to the response later. It is also handy if you use output buffering, and would not like to see added unwanted whitespace at the end of the parts generated by the included files.\u00a0 more>><\/a><\/em><\/p><\/blockquote>\n

 <\/p>\n

\u627e\u4e86\u4e00\u4e9b\u8d44\u6599\uff0c\u5927\u5bb6\u5bf9PHP\u95ed\u5408\u6807\u7b7e\u7684\u603b\u7ed3\u5982\u4e0b\uff1a<\/p>\n

\u597d\u5904\uff1a<\/strong>\u5982\u679c\u8fd9\u4e2a\u662f\u4e00\u4e2a\u88ab\u522b\u4eba\u5305\u542b\u7684\u7a0b\u5e8f\uff0c\u6ca1\u6709\u8fd9\u4e2a\u7ed3\u675f\u7b26\uff0c\u53ef\u4ee5\u51cf\u5c11\u5f88\u591a\u5f88\u591a\u95ee\u9898\uff0c\u6bd4\u5982\u8bf4\uff1aheader, setcookie, session_start\u8fd9\u4e9b\u52a8\u4f5c\u4e4b\u524d\u4e0d\u80fd\u6709\u8f93\u51fa\uff0c\u5982\u679c\u4e0d\u5c0f\u5fc3\u5728?> \u540e\u8fb9\u52a0\u4e86\u4e0d\u53ef\u89c1\u5b57\u7b26\uff08\u591a\u4f59\u7684\u7a7a\u683c\u3001\u6362\u884c\u7b26\uff09\u7b49\u7834\u574f\u9875\u9762\u663e\u793a\uff0c\u5c31\u4f1a\u62a5”Header already sent”\u9519\u8bef\uff0c\u4e0d\u5199\u7684\u8bdd\u4e0d\u4f1a\u6709\u6b64\u95ee\u9898\u3002\u53e6\uff0c\u53ef\u4ee5\u76f4\u63a5\u628a\u5149\u6807\u79fb\u5230\u6700\u540e\uff0c\u63a5\u7740\u7f16\u7a0b\u3002<\/p>\n

\u574f\u5904\uff1a<\/strong>\u5728dreamweaver\u7684\u89c6\u56fe\u6a21\u5f0f\u4e0b\uff0c\u4e00\u56e2\u7cdf\u3002<\/p>\n

\u5173\u4e8ePHP\u95ed\u5408\u6807\u7b7e\u5b98\u65b9\u89e3\u91ca\u662f\uff1aPHP\u95ed\u5408\u6807\u7b7e\u201c?>\u201d\u5728PHP\u4e2d\u5bf9PHP\u7684\u5206\u6790\u5668\u662f\u53ef\u9009\u7684\u3002\u4f46\u662f\uff0c\u5982\u679c\u4f7f\u7528\u95ed\u5408\u6807\u7b7e\uff0c\u4efb\u4f55\u7531\u5f00\u53d1\u8005\uff0c\u7528\u6237\uff0c\u6216\u8005FTP\u5e94\u7528\u7a0b\u5e8f\u63d2\u5165\u95ed\u5408\u6807\u7b7e\u540e\u9762\u7684\u7a7a\u683c\u90fd\u6709\u53ef\u80fd\u4f1a\u5f15\u8d77\u591a\u4f59\u7684\u8f93\u51fa\u3001php\u9519\u8bef\u3001\u4e4b\u540e\u7684\u8f93\u51fa\u65e0\u6cd5\u663e\u793a\u3001\u7a7a\u767d\u9875\u3002\u56e0\u6b64\uff0c\u6240\u6709\u7684php\u6587\u4ef6\u5e94\u8be5\u7701\u7565<\/strong>\u8fd9\u4e2aphp\u95ed\u5408\u6807\u7b7e\uff0c\u5e76\u63d2\u5165\u4e00\u6bb5\u6ce8\u91ca\u6765\u6807\u660e\u8fd9\u662f\u6587\u4ef6\u7684\u5e95\u90e8\u5e76\u5b9a\u4f4d\u8fd9\u4e2a\u6587\u4ef6\u5728\u8fd9\u4e2a\u5e94\u7528\u7684\u76f8\u5bf9\u8def\u5f84\u3002\u8fd9\u6837\u6709\u5229\u4e8e\u4f60\u786e\u5b9a\u8fd9\u4e2a\u6587\u4ef6\u5df2\u7ecf\u7ed3\u675f\u800c\u4e0d\u662f\u88ab\u5220\u8282\u7684\u3002<\/p>\n

\u4e0d\u5f53\u7684:<\/strong><\/p>\n

<?php<\/p>\n

echo “Here’s my code!”;<\/p>\n

?><\/p><\/blockquote>\n

\u9002\u5f53\u7684:<\/strong><\/p>\n

<?php<\/p>\n

echo “Here’s my code!”;<\/p>\n

\/* End of file myfile.php *\/<\/p>\n

\/* Location: .\/system\/modules\/mymodule\/myfile.php *\/<\/p><\/blockquote>\n

\u56e0\u6b64\uff0c\u5982\u679c\u662f\u7eafphp code\u6587\u4ef6\u7684\u8bdd\uff0c\u5e94\u8be5\u7701\u7565?>\u7ed3\u675f\u6807\u8bc6\u7b26\u3002<\/p>\n

\u53c2\u8003\u8d44\u6599\uff1a<\/strong>
\n
http:\/\/php.net\/manual\/en\/language.basic-syntax.instruction-separation.php<\/a>
\nhttp:\/\/codeigniter.org.cn\/user_guide\/general\/styleguide.html#php_closing_tag
\n<\/a>
http:\/\/www.gongliyi.com\/blog\/?p=40<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"

PHP\u5b98\u65b9\u6587\u6863\u7684\u4e00\u6bb5\u8bf4\u660e\uff1a The closing tag of a PHP block at the end […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[9],"tags":[98,97,59],"_links":{"self":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts\/1456"}],"collection":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/comments?post=1456"}],"version-history":[{"count":4,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts\/1456\/revisions"}],"predecessor-version":[{"id":1562,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts\/1456\/revisions\/1562"}],"wp:attachment":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/media?parent=1456"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/categories?post=1456"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/tags?post=1456"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}