<?php, <?, <?=, whats the difference?
Possible Duplicate:
Reference - What does this symbol mean in PHP?
I don't know if this has been asked before, but here goes: What's the difference between <?php
, <?=
, and <?
?
I'm just curious, and people have been telling me to use <?php
instead of <?
, but I just use <?
because it works for me and it's faster. I ain't seein' no diff'rence (redneck accent for extra pleasures...).
<?php
and <?
are equivalent, except it's generally preferred to use <?php
since not every server configuration may have the short opening PHP tags option enabled.
<?=
is a shortcut for echoing back the value of a variable/expression, ie
<?=$var ?>
is similar to
<?php echo $var; ?>
链接地址: http://www.djcxy.com/p/59160.html
上一篇: 这个符号在php中的含义是什么