The short tag is only used to output variable or expression. The general usage is
<?=$a?> <?=(表达式)?>
is equivalent to
echo $a?>
The first is according to the standard writing method of PHP. php...?>
The way to open the short tag is as follows
The second is to modify the value of short_open_tag in the config file(php.ini) to on.
If set to Off, PHP files similar to this form cannot be parsed normally:
<? phpinfo() ?>
but can only parse
<?php phpinfo() ?>
This form of php file
So if we want php to support short tags, we need to set short_open_tag
to On.
The above is the detailed content of How to enable short tags in php?. For more information, please follow other related articles on the PHP Chinese website!