For printing any PHP variable the following syntax is used sometimes
<?= $x ?>
Can anyone please explain when should I use this instead of
<?php echo $x; ?>
and what the name of that operator <?=
?
Any help is appreciated.
For printing any PHP variable the following syntax is used sometimes
<?= $x ?>
Can anyone please explain when should I use this instead of
<?php echo $x; ?>
and what the name of that operator <?=
?
Any help is appreciated.
It's a "short tag"; this one is an abbreviation for "<?php echo"
. You need to be careful when using it or any other short tags as not all servers are configured to render them correctly.
A bit more info can be found here: http://php.net/manual/en/language.basic-syntax.phptags.php