PHP短标签与长标签
问题描述:
可能重复:
可以使用PHP短标签吗?
Possible Duplicate:
Are PHP short tags acceptable to use?
使用哪个更好,或被认为是更好的做法:<?php
或<?
.我一直想知道.还是对程序员更偏爱.
Which is better to use, or considered better practice: <?php
or <?
. I've always wanted to know. Or is it more of a preference for the programmer.
答
<?php
是官方标准.我从来没有遇到过让浏览器感到困惑的问题,但是仅仅使用<?
也可以声明XML,这可能不是形成表单的最佳习惯.
<?php
is the official standard. I've never encountered a problem where a browser was confused, but just using <?
can also declare XML and might not be the best habit to form.
不过,我会告诉您-其他程序员将始终赞赏该标准.我肯定会选择<?php
.
I'll tell you this though - other programmers will always appreciate the standard. I would go with <?php
for sure.