What does this PHP tag mean: <?=

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
aneuryzma
Forum Contributor
Posts: 106
Joined: Sat May 17, 2008 7:03 am

What does this PHP tag mean: <?=

Post by aneuryzma »

hi,

What does this PHP syntax mean: <?=
Is the same of <? or <?php ?

thanks
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: What does this PHP tag mean: <?=

Post by requinix »

<?=...?> is the same as <? echo ...; ?>. Both require that short tags be enabled.
internet-solution
Forum Contributor
Posts: 220
Joined: Thu May 27, 2010 6:27 am
Location: UK

Re: What does this PHP tag mean: <?=

Post by internet-solution »

Its the output tag

Code: Select all

<?= [output here] ?>
The above is same as below

Code: Select all

<?php echo "some output"; ?> 
Although it saves you typing, this is not recommended, if you change server with this code might not work. Same applies to short tag <?. These two tags have to be enabled in your php.ini file.
Post Reply