0

Previous I bumped into codes like this:

<?php
  $var="hello";
?>
<?=$var?>

It simply prints out the content of $var, so... is the syntax equivalent to echo $var? I'll also appreciate an answer pointing to a related manual page. Since the syntax is not searchable.

sleepsort
  • 1,321
  • 15
  • 28

1 Answers1

2

Yes, <?=$var?> is the same as <?php echo $var; ?>

From PHP.net manual: echo also has a shortcut syntax, where you can immediately follow the opening tag with an equals sign. Prior to PHP 5.4.0, this short syntax only works with the short_open_tag configuration setting enabled.

You can read more here.

Sergio
  • 28,539
  • 11
  • 85
  • 132