knojiyak — 2013-10-27T11:46:20-04:00 — #1
i am doing work on core php.
please tell me some element of php.
what is the different b/w in this element?
1) <?PHP ?>
2) <? ?>
3) <?= ?>
Thank you in advance
Please tell me if you know...
scallioxtx — 2013-10-27T13:53:11-04:00 — #2
In principle <? ?> and <?php ?> are the same, except that some servers the use of <? ?> is disabled (the setting is short_open_tag in php.ini, might you be interested) whereas <?php ?> is always supported.
<?= $something ?> is the equal to <?php echo $something ?> or indeed <? echo $something ?>. This syntax (<?= ?>) could be disabled on PHP versions prior to 5.4 (together with <? ?> via short_open_tag), but since 5.4 is always available, regardless of the short_open_tag setting.