Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the examples of PHP simple programs

Shulou Source: shulou.com Published: 2022-06-02 19:37:06 10月03日 Update

This article mainly shows you "what are the examples of PHP simple programs", which is easy to understand and organized. I hope it can help you solve your doubts. Let me lead you to study and learn this article "what are the examples of PHP simple programs?"

Here is an example of a simple PHP program that outputs Hello World on a standard output device, which is usually used as a program when you start learning a programming language:

< ?php echo 'Hello World!'; ?>

Or

< ? echo 'Hello World!'; ?>

From the PHP simple program example, we can see that the PHP language is embedded in the

< ?php…?>

"or"

< ?…?>

"the part between. And the end result of this program will be:

Hello World!

However, it is recommended that you write your program in this way. In the default configuration file php.ini of php, this setting is usually Off. If you need to open this setting, you can refer to the setting of "short_open_tag = Off" in php.ini.

Phpinfo

The following is an example of a PHP simple program that outputs settings about PHP on a standard output device, such as PHP variables, modules:

< ?php phpinfo(); ?>

The above is all the content of the article "what are the examples of PHP simple programs?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Programs examples output content articles learning standards devices languages help between variables suggestions ways easy to understand more organization modules knowledge results Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Shulou Tech Info Microsoft vpn OPPO Reno