Page 1 of 1

What does <?=$someVar?> do?

Posted: Sat Jul 20, 2002 12:28 am
by Steve Lawson
I see this in the 'mymarket' PHP scripts [Point in tutorial that includes link to mymarket mymarket1.tar.gz file]. Specifically what does the '<?=' part mean?

Example:

Code: Select all

<a href="<?=$ME?>?mode=add">&#1111;+C] Add Category</a>
BTW: $ME = $SCRIPT_NAME;

I tried to find it in the PHP Manual to no avail.

Posted: Sat Jul 20, 2002 12:30 am
by protokol
<?= $somevar ?> is the exact same thing as <?php echo $somevar ?>

Posted: Sat Jul 20, 2002 1:36 am
by hob_goblin
from the manual
echo() also has a shortcut syntax, where you can immediately follow the opening tag with an equals sign.

Code: Select all

I have <?=$foo?> foo.
http://www.php.net/echo

Posted: Sat Jul 20, 2002 2:01 am
by gnu2php
The manual also says:
PHP.net/echo wrote:Note: This short syntax only works with the short_open_tag configuration setting enabled.
In case anyone has a problem using it.