English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Idle with nothing to do, I studied the field of PHP, which is completely different from Java and C#. PHP, also known as (Foreign Name: PHP: Hypertext Preprocessor, Chinese Name: “HyperText Preprocessor”), for beginners learning PHP, it is necessary to master the deployment of Apache. The deployment of Apache will be discussed later. Of course, there are also many one-click deployment tools for PHP, Apache, and MySQL now, such as WAMP (Windows, Apache, MySQL, PHP); there are many resources on the Internet, so I will not list the relevant resource links here to avoid the suspicion of obtaining points. To get back to the point, let's talk about the basic knowledge of PHP below.
Four delimiters (what are delimiters?) Can be understood as starting symbols and delimiters.Why does php have four delimiters? It's not hard to understand. First, php is an open-source language, and its development came after html, c#, java. There is no hate without reason, and no love without reason. Although php is open-source, it still needs attention. Most of the people who pay attention may be like us, c#, java practitioners, who need a process of acceptance for a new development language. Therefore, the php official website has four delimiters. Let's learn together below? If it's not good, please feel free to criticize!
1.Standard syntax <?php ?>。is also recommended by the official website, starting symbol <?php ending symbol ?> is easier to understand, actually similar to the starting symbol of html, and for beginners, I recommend using Dreamwearm tool, which has <? Defines server tags, which is better understood here. Since it is related to the server area, it is natural for php to be able to write dynamic pages, corresponding to the definition of dynamic and static pages in html. I don't want to go into too much detail here. The difference between static and dynamic is whether to request the service, and the syntax is as follows:
<?php echo '锄禾日当午'; ?> <br> <?php echo '床前明月光'; ?>
2.Simple syntax <? ?>。This syntax requires configuration of the php configuration file, and I will not recommend it here. Specifically, find the php.ini file in the php installation directory; how do you find it? As an experienced developer, it's not a problem for me. Generally, this file is stored in folders with a 'con' suffix, or directly in the root directory of the file, or you can use the most笨办法 to search in the top-level folder.*.ini, open the ini file. Here, let's expand our knowledge: why do some configuration files end with .ini? It's not hard to understand. INI is an abbreviation for 'initialization' in English, and the INI file format is an informal standard for configuration files on some platforms or software, consisting of sections and keys, commonly used in the Microsoft Windows operating system. This type of configuration file usually has the file extension INI, hence the name. Open it with Notepad or editplus, which is undoubtedly one of the essential software for programmers, with powerful text editing features. Search for 'short_open_tag' in the file, the literal meaning of which should be easy to understand: remove the leading semicolon to uncomment this line.
<? echo '锄禾日当午'; ?>
3.Asp style writing<% %>,This is similar to the way of calling back-end service pages in ASP. Those who have studied aspx.net should be familiar with this writing style. Of course, to make this writing style effective, you also need to modify the php.ini configuration file. Search for 'asp_tags' in this article and release the comments. The specific writing method is as follows:
<% echo '锄禾日当午'; %>
4.Js style writing<script language="php"></script>We can also understand it as script writing. Regarding the understanding of scripts, here's a joke for everyone: why the translation of some foreigners' works into Chinese sounds a bit stiff, of course, this is just my opinion, as I am not an English professional. Script, it can be understood as inserting text like a foot at any place in the text. That's why js can be written in the header of html, at the end, even in the middle. Having talked so much, here is the specific writing method
<script language="php"> echo '锄禾日当午'; </script>
That's all for this article. I hope the content of this article can bring some help to everyone's learning or work, and I also hope to support the Yelling Tutorial more!
Statement: The content of this article is from the Internet, and the copyright belongs to the original author. The content is contributed and uploaded by Internet users spontaneously. This website does not own the copyright, has not been manually edited, and does not assume relevant legal liability. If you find any content suspected of copyright infringement, please send an email to: notice#oldtoolbag.com (Please replace # with @ when sending an email to report abuse, and provide relevant evidence. Once verified, this site will immediately delete the infringing content.)