Re: [閒聊] 純PHP開頭跟結尾的檔案沒有加?> 以及 < …

看板PHP作者 (我是沒牌的營養師!)時間17年前 (2008/09/10 14:27), 編輯推噓1(102)
留言3則, 2人參與, 最新討論串1/2 (看更多)
※ 引述《qazsd (Be brave & outstanding)》之銘言: : test.php : <?php : echo 'hello'; : ----檔案完畢(最後面沒有加?>) : 一樣是可以執行,但是不清楚會不會有什麼影響或是潛在的bug 節錄自ZF的手冊的一段話(code standard) http://framework.zend.com/manual/en/coding-standard.php-file-formatting.html For files that contain only PHP code, the closing tag ("?>") is never permitted. It is not required by PHP, and omitting it prevents the accidental injection of trailing whitespace into the response. : 另外 <?= 這個用法有PHP或是其他東西版本的限制嗎 : 就是說安裝的是某幾版以上的PHP 才能執行 : 就像PHP 5以上就都得寫<?php 而不能寫 <? 一樣 這個請自行參閱php.ini裡的說明 :) -- 誠徵PHP網站工程師,熟MVC架構 http://blog.eddie.com.tw/ 全職、兼職可,意者請敲 :) http://www.eddie.com.tw/ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.132.128.37 ※ 編輯: aquarianboy 來自: 220.132.128.37 (09/10 14:28)

09/10 14:29, , 1F
php.ini裡的short_open_tag段落
09/10 14:29, 1F

09/10 15:47, , 2F
他說的files該不會是只用zend framework開發的吧??
09/10 15:47, 2F

09/10 16:10, , 3F
http://tinyurl.com/6fpt4z PHP網站記得多翻一下囉
09/10 16:10, 3F
文章代碼(AID): #18nsZO2j (PHP)
文章代碼(AID): #18nsZO2j (PHP)