search
HomeBackend DevelopmentPHP ProblemCan php write web pages?

Can php write web pages?

Oct 23, 2019 am 09:43 AM
php

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>

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!

Statement
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!