How to set and enable php abbreviation (php.ini, short_open_tag) in php

藏色散人
Release: 2023-04-09 15:12:01
forward
2981 people have browsed it

How to set and enable php abbreviation (php.ini, short_open_tag) in php

Recommended: "PHP Video Tutorial"

php Set to enable php abbreviation (php.ini, short_open_tag)

Introduction to the usage environment of this tutorial

伺服器端:Ubuntu 18.04 LTS
资料库:Mariadb 10.1.34(Mysql)
语言版本:php 7.3
本机端:MacOS High Sierra
Copy after login

Enabling php abbreviations can save some writing. Although it is not much different, it is just that if there are too many scripts, it will look easier to identify

For example, php scripts need to be added at the beginning On php

<?php
    // do..
?>
Copy after login

After turning on the abbreviation, you don’t need it

<?
    // do..
?>
Copy after login

And when you want echo information

<?php echo $data; ?>
Copy after login

After turning on the abbreviation

<?=$data;?>
Copy after login

, is it much cleaner? It’s over!

There may be other abbreviations, but I didn't find them~

Just note that if you use crontab to run a php script, the script still needs to have

Then start setting the abbreviation function

Go to the php version you are currently using, there will be an apache2 folder inside

Go directly to nano and enter php.ini

$ nano /etc/php/7.X/apache2/php.ini
Copy after login

Then find short_open_tag and change it to On

short_open_tag = On
Copy after login

Don’t forget to reload

$ service apache2 reload
Copy after login

The above is the detailed content of How to set and enable php abbreviation (php.ini, short_open_tag) in php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:segmentfault.com
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