In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
Xiaobian to share with you php basic example analysis, I believe most people still do not know how, so share this article for your reference, I hope you read this article after a great harvest, let us go to understand it!
Php Introduction
With the rapid development of network technology, various script languages based on server to create dynamic websites emerge one after another. PHP is unique among many dynamic website language technologies because of its simplicity, ease of use and portability. So what exactly is PHP and how do I use PHP? This chapter will answer these questions later. This chapter will give you an overview of PHP and how to incorporate PHP code into a regular Web page.
1.1 About static and dynamic web pages
At present, web pages on the Internet have two forms: static web pages and dynamic web pages. Before we talk about these two kinds of web pages, let's first understand the client and server in the network structure. A server is a device installed with server software and can provide services such as web browsing, database queries, etc. to clients. The client, on the other hand, obtains services such as web browsing and software downloading from the server through client software such as web browsers. Simply put, the server is the service provider and the client is the service acquirer.
1.1.1 Traditional static HTML
Static web pages have the following characteristics: Static web pages cannot be automatically updated. The content of static web pages does not change with the change of browsing conditions such as browsing users and browsing time. Once a static web page is published, it is a real file, corresponding to a URL, whether the viewer browses it or not. There are considerable limitations to using static web pages for human-computer interaction.
1.1.2 Difference between dynamic and traditional web pages
Different from the implementation method of static web pages, the implementation process of dynamic web page services is as follows: the client submits an application to the server, and the server processes the code inside the dynamic web page on the server according to the user request, and then sends the generated result to the client. The pattern is as shown in the figure:
1.1.2 Difference between dynamic and traditional web pages
Dynamic web pages have the following characteristics:
Dynamic web pages run on the server side.
Different people, different times, different places browse the same dynamic web page, according to the code processing results are different, will return different content.
Dynamic web pages only return a complete web page when viewed by the client, and they are not a web page file that exists independently on the server.
Compared with static web pages, dynamic web pages are easier to achieve human-computer interaction.
Dynamic Web sites are easier to maintain than static Web sites.
1.2 about PHP
The previous section introduced readers to static and dynamic web pages, and PHP is one of the dynamic web technologies. So what exactly is PHP and what is its history? How does PHP compare to other dynamic web technologies? This section answers these questions for readers.
1.2.1 What is PHP?
PHP was originally interpreted as a personal Home page. PHP is also known as PHP: Hypertext Preprocessor. PHP is a server-side, cross-platform scripting language that embeds HTML. The server-side execution features indicate that it is a type of dynamic web page. Cross-platform means PHP can run not only on Linux but also on UNIX or Windows. It can also be easily embedded in plain HTML pages, where all the user has to do is add PHP code to the plain HTML page.
1.2.2 History of PHP
PHP was originally developed by Rasmus Lerdorf in 1994. A second version of PHP was released in mid-1995 under the name PHP/FI (Form Interpreter).
In mid-1997, development plans for the third version began, with Zeev Suraski and Andi Gutmans joining the team, and the third version was named PHP 3.0.
PHP 4.0 was released in May 2000. It uses the Zend (Zeev+Andi) engine to provide higher performance.
PHP 5 was released in July 2004. PHP 5 ushered in a new era of PHP programming. Zend II engine adoption, complete object model, improved syntax design. PHP is a fully designed, truly object-oriented scripting language.
1.2.3 PHP compared to other CGI programs
As a server-side programming language, PHP has its own characteristics compared with other CGI programs such as ASP.NET, JSP, etc., mainly in the following aspects: Web server support. Platform support. Script languages are different. Database support varies. Object-oriented support varies.
1.3 The first program-HELLO WORLD!
HELLO WORLD!
PHP code added to page 1.3.1
PHP is an embeddable language. That is, it can easily be added to common HTML pages. When a user requests a PHP file, the relevant PHP code is interpreted and executed on the server side to generate new HTML information, and then sent to the user together with the original HTML code.
1.3.2 Adding comments to PHP pages
PHP has three types of comments:
Single-line comments: #,//
Multiline comments: /*some code*/
The above is "php basic sample analysis" all the content of this article, thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.