Why should we use <?php for embedding php code?
I once posted a question here with php code embedded using <?
.
Someone told me I should NOT do that and I should use <?php
The person did not tell me why it is so. Can someone please explain why it is unsafe to us开发者_如何学Pythone <?
?
<?
(the short tags) can be disabled in the PHP configuration, see short_open_tag
.
- http://php.net/manual/en/ini.core.php
Why disable it? In some cases you'd want to use <?xml..
definitions for example, sure there are other ways to output that, but it's just safest to use <?php
- especially if you plan on moving your code from server to server.
精彩评论