Home >Backend Development >PHP Problem >Can php write web pages?
Can php write web pages?
php can write web pages. PHP, "Hypertext Preprocessor", is a general-purpose open source scripting language. PHP is a scripting language executed on the server side. It is similar to C language and is a commonly used website programming language. PHP's unique syntax mixes C, Java, Perl, and PHP's own syntax. It is conducive to learning and widely used. It is mainly suitable for the field of web development.
The first PHP page
Create a file named hello.php under the web server root directory (DOCUMENT_ROOT), and then complete the following content:
Example #1 The first PHP script: hello.php
<html> <head> <title>PHP 测试</title> </head> <body> <?php echo '<p>Hello World</p>'; ?> </body> </html>
Enter the URL of the web server in the browser's address bar to access this file, and add "/hello.php" at the end. If developing locally, this URL is usually http://localhost/hello.php or http://127.0.0.1/hello.php, depending on the web server settings. If all settings are correct, then this file will be parsed by PHP, and the following result will be output in the browser:
<html> <head> <title>PHP 测试</title> </head> <body> <p>Hello World</p> </body> </html>
This program is very simple, it just uses PHP's echo statement to display Hello World .
For more PHP related knowledge, please visit PHP Chinese website!
The above is the detailed content of Can php write web pages?. For more information, please follow other related articles on the PHP Chinese website!