What's the use of <?= ?> tags in PHP?
This question already has an answer here:
<?=
this is the short tag in php.
Its equivalent to <?php echo
Your code is executed as
<?php
echo $a = 10;
echo $a . "n";
<?=
is replaced with <?php echo
So you are getting 10 twice in output.
<?php echo 'whatever'; ?>
<? echo 'whatever'; ?>
and
<?='whatever';?>
are the same thing.
Just make sure you have short_open_tag = On
in php.ini
.
It basically saves you from typing as much.
链接地址: http://www.djcxy.com/p/59344.html上一篇: 在PHP中使用<?= $ foo?>
下一篇: PHP中使用<?=?>标记有什么用?