Last Updated: September 09, 2019
·
761
· nikebot

PHP echo tip

Tired of doing <?php echo $foo; ?> ?<br>

Just do <?= $foo; ?> and it will echo the $foo variable!

<br>


<? and <?= are called short open tags, and are not always enabled (see the short open tag directive) with PHP 5.3 or below (but since PHP 5.4.0, <?= is always available).<br><br>
see reference

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

PHP applications still send a browser full of JavaScript. Hardening the server does not inventory the payment, analytics, and plugin scripts that run after the HTML is delivered.

Security insights from Cside