How does PHP syntax <?=$var;?> work?

This question already has an answer here:

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

  • <?=$var;?>
    

    is the same as

    <?php echo $var;?>
    

    But it will only work if you have:

    short_open_tag=On
    

    in your php.ini

    As of php 5.4 short_open_tag isn't required. The shorthand version is always available. http://php.net/manual/en/ini.core.php#ini.short-open-tag

    @jszobody: Thanks for your comment!

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

    上一篇: 我需要一个尾随分号吗?

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