为什么PHP使用字符“<! - ?php”? - >

时间:2013-05-29 18:34:09

标签: php history

在服务器端包含的所有可能的分隔符中,为什么PHP选择“少于问号php”?

Rasmus(PHP的发明者)私下回复了我,因为你关闭了这个问题,这就是答案:

它是SGML处理指令标签。见http://en.wikipedia.org/wiki/Processing_Instruction。 它最初是<? ... >,但网络已移至XML,因此它变为<? ... ?>。我一开始就遗漏了PITarget,因为没有其他人在网络世界中使用它们,但是当XML内容开始入侵html时不得不添加它。

1 个答案:

答案 0 :(得分:1)

为什么不呢?...如果您只想写'&lt;?',请查看short_opentag = On配置但它不推荐,我不确定它已被弃用。