Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Basic usage of PHP and use cases of phpinfo ();

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article is about the basic usage of PHP and the use cases of phpinfo ();. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Write the following code in the abc.php file.

You will see a web page, usually with content, as shown in the following figure:

Translate this sentence into Chinese for you.

We just saw that this code has generated a web page. I don't understand what it means. Now I'll explain it to you bit by bit.

However, the above [question mark, angle brackets] indicates that the PHP code has been written. After that, it has nothing to do with my PHP.

Can you watch it now? Excuse me: phpinfo () is followed by a semicolon (;), and there are two carriage returns on the first and last lines of phpinfo (). Excuse me, what does this mean?

Now I'll tell you the answer:

Phpinfo is a function (function) that displays detailed PHP information about the current computer (server). Later on, I will specifically explain the function phpinfo (). This function must be remembered!

The computer is a very stupid thing. He needs us to tell him artificially that the code is finished. We use the semicolon (;) to tell him that the code is finished. Therefore, as long as we finish writing a piece of code, we need to add a semicolon (;) after it.

The carriage return blank line before and after the two lines is to make the code more beautiful, avoid stacking each other, and make people look uncomfortable. In fact, it doesn't matter how many blank return lines you have in the middle, just make sure you look good. PHP's syntax interpreter (the core part of PHP) does not handle these blank lines.

Note:

The code part of php should be written in half-width English, and many people can easily write full-width English and symbols to cause errors in PHP code.

The last line of PHP code can be added with or without semicolons. Because many learners, especially beginners, often make a mistake: write a line of code without a semicolon. Therefore, it is easy to report errors. We usually stipulate in the company that a semicolon must be added when a line of code is written.

PHP can also have a concise declaration pattern, which we focus on code practice at this stage. With regard to the configuration of the environment, learning is not recommended for the time being. We will explain it specifically in the following chapters.

Above, it is very easy to cause mistakes in actual development.

When we write the file abc.php, we only use the English half-foot (a-zA-Z0-9 feet -) to name the file. Do not use Chinese to name files, do not use special signs, do not add spaces in the middle, and strictly distinguish between sizes.

Thank you for reading! This is the end of the article on "the basic usage of PHP and the use cases of phpinfo ();". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report