Using <?=$foo?> in PHP

This question already has an answer here:

  • What does '<?=' mean in PHP? 8 answers

  • From the manual

    short_open_tag
    Tells PHP whether the short form () of PHP's open tag should be allowed. If you want to use PHP in combination with XML, you can disable this option in order to use inline. Otherwise, you can print it with PHP, for example: '; ?>. Also, if disabled, you must use the long form of the PHP open tag ().

    Note: This directive also affected the shorthand <?= before PHP 5.4.0, which is identical to <? echo <? echo . Use of this shortcut required short_open_tag to be on. Since PHP 5.4.0, <?= is always available.

    asp_tags
    Enables the use of ASP-like <% %> tags in addition to the usual <?php ?> tags. This includes the variable-value printing shorthand of <%= $value %> .

    链接地址: http://www.djcxy.com/p/59346.html

    上一篇: PHP语法如何<?= $ var;?>工作?

    下一篇: 在PHP中使用<?= $ foo?>