可能重複:
What is the difference between the PHP open tags 「<?=」 and 「<?php」/「<?」?有什麼區別使用<?php ... ?>和<? ... ?>
這有什麼區別使用
<?php
something;
something2;
?>
和
時<?
something;
something2;
?>
無處不在我看到<?php ... ?>
被使用。它有什麼優勢嗎?
可能重複:
What is the difference between the PHP open tags 「<?=」 and 「<?php」/「<?」?有什麼區別使用<?php ... ?>和<? ... ?>
這有什麼區別使用
<?php
something;
something2;
?>
和
時<?
something;
something2;
?>
無處不在我看到<?php ... ?>
被使用。它有什麼優勢嗎?
請勿使用<? ... ?>
並且您將永遠不會有問題。
Google php shorthand
。
<?
要求在服務器上啓用短標籤。它與其他一些指令相沖突(如<?xml
)。
僅當啓用short_open_tag
時,第二選項纔有效。
此外,如果啓用,則不能在XML內使用php,其中有時會使用<?xml ...>
。
你說過,男人。 – 2012-04-09 18:09:36