Search code examples
phpasp-classictagsshort

Is <?= a valid php statement?


Is there a php.ini setting to turn <?=$phpval?>-style output on, or has someone on this project been smoking too much ASP?


Solution

  • Yes,

    <?php $var = 'Hello, World!"; ?>
    <?= $var ?>
    

    Is the same as;

    <?php $var = 'Hello, World!"; ?>
    <?php echo $var; ?>