Yes, there is.
The <?php
tag is the default for PHP file openings unless Short Tag , which allows you to open PHP with <?
(which may conflict with XML statements)
The <?=
tag is quite simple:
Note: This directive also affects the abbreviated form <?=
before PHP > 5.4.0
, which is the same as <? echo
. For use of this abbreviation it is
short_open_tag is active. From PHP 5.4.0
, <?=
is always available.
Instead of using <?php echo $variable; ?>
just use <?=$variable?>
Related to the code getting cleaner and readable.
I should point out that this is not from Laravel as described in the question, but rather from PHP.
Considerations
As you are studying Laravel and you have barred yourself from passing on values to views
recommend taking advantage of and studying the Blade
In the blade output variables only using:
{{ $variable }}
Which is equivalent to:
echo $variable;
Much simpler, right?