What does <?=$someVar?> do?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Steve Lawson
Forum Newbie
Posts: 2
Joined: Wed Jul 17, 2002 9:28 pm
Location: Simi Valley, CA, USA
Contact:

What does <?=$someVar?> do?

Post 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.
Last edited by Steve Lawson on Sat Jul 20, 2002 12:31 am, edited 1 time in total.
User avatar
protokol
Forum Contributor
Posts: 353
Joined: Fri Jun 21, 2002 7:00 pm
Location: Cleveland, OH
Contact:

Post by protokol »

<?= $somevar ?> is the exact same thing as <?php echo $somevar ?>
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post 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
gnu2php
Forum Contributor
Posts: 122
Joined: Thu Jul 11, 2002 2:53 am

Post 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.
Post Reply