Usage of <?= ?> tag
Usage of <?= ?> tag
In PHP, to print a values of a variable we use echo and print statements.
Instead of that to display a php variables directly in the html page by using this tag. This is the another way of print statement.
Syntax:
<?= (expression or variables) ?>
here, The output is displayed directly to the browser.
Exampe:
<?php
$str = “Good Morning”;
?>
<h1>hello <?=$str?></h1>
The above code displays Hello Good Morning
in H1 format in browser.
