0

I recently discovered some code that output a variable in php like this:

<?=$var;?>

I have never seen this before. Is it the same as

<?php echo $var;?>

?

Horen
  • 11,184
  • 11
  • 71
  • 113

1 Answers1

2
<?=$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!

hek2mgl
  • 152,036
  • 28
  • 249
  • 266
  • As of php 5.4 short_open_tag isn't required. The shorthand version is always available. http://www.php.net/manual/en/ini.core.php#ini.short-open-tag – jszobody Apr 13 '13 at 15:06