Page 1 of 1

What does this PHP tag mean: <?=

Posted: Sun Jun 27, 2010 3:26 am
by aneuryzma
hi,

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

thanks

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

Posted: Sun Jun 27, 2010 4:01 am
by requinix
<?=...?> is the same as <? echo ...; ?>. Both require that short tags be enabled.

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

Posted: Sun Jun 27, 2010 4:01 am
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.