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, i. e.
<?=$var ?>
is similar to
<?php echo $var; ?>