How to enable short tags in php?

怪我咯
Release: 2023-03-13 21:38:01
Original
3115 people have browsed it

The short tag is only used to output variable or expression. The general usage is

<?=$a?>
<?=(表达式)?>
Copy after login

is equivalent to
echo $a?>

The first is according to the standard writing method of 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()
?>
Copy after login

but can only parse

<?php
phpinfo()
?>
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template