Can php write web pages?

藏色散人
Release: 2023-02-27 17:42:02
Original
4611 people have browsed it

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 &#39;<p>Hello World</p>&#39;; ?>
 </body>
</html>
Copy after login

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>
Copy after login

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!

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template