Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does this symbol mean in PHP <?=

Tags:

php

symbols

What does this symbol mean in PHP <?=?

Example usage:

<h2>Manage Role: > (<?= $myACL->getRoleNameFromID($_GET['roleID']); ?>)</h2> 
like image 437
ekalaivan Avatar asked Dec 26 '09 17:12

ekalaivan


4 Answers

To add to Mark's answer: The short_tags option must be enabled for the <?= syntax to be valid. This presents a major portability problem when moving to a server that has this option disabled.

See the PHP Manual for more info on short tags

like image 95
Mike B Avatar answered Sep 28 '22 07:09

Mike B


It's functionally the same as <?php echo $myACL->getRoleNameFromID($_GET['roleID']); ?>

like image 33
Mark Biek Avatar answered Sep 28 '22 06:09

Mark Biek


It's the PHP Short Tag equivalent of printing.

From the PHP INI:

Using short tags is discouraged when developing code meant for redistribution ; since short tags may not be supported on the target server.

See "Are PHP Short Tags Acceptable to Use?" on StackOverflow.

like image 22
Sampson Avatar answered Sep 28 '22 07:09

Sampson


The <?= ... > tag says to execute whatever is in ... and output the results.
like image 25
Reverend Gonzo Avatar answered Sep 28 '22 05:09

Reverend Gonzo