Basic php knowledge and basic php knowledge

Source: Internet
Author: User

Basic php knowledge and basic php knowledge

PHP is a powerful server-side scripting language for creating dynamic and interactive sites. scripts are executed on servers ].

PHP files can contain text, HTML, CSS, and PHP code. The execution results on the server are returned to the browser in plain text.

 

Php can do many things:

1. generate dynamic page content

2. Create, open, read, write, delete, and close files on the server

3. Receive form data

4. Send and retrieve cookies

5. add, delete, and modify data in the database

6. restrict user access to some pages on the website

7. encrypt data

8. You can output HTML, images, PDF files, and even Flash videos. You can also output any text, such as XHTML and XML.

 

Php advantages:

Can run on a variety of platforms (Windows, Linux, Unix, Mac OS X, etc)

Compatible with almost all servers (Apache, IIS, etc)

Supports multiple databases

It is free, easy to learn, and can run efficiently on the server.

 

Php syntax:

PHP script with <? Php, starting with?> It can be placed anywhere in the document. The default file extension is ". php ".

<? Php // here is the PHP code?>

PHP files usually contain HTML tags and some PHP script code. PHP statements end with a semicolon (;)

<! DOCTYPE html> <body> 

PHP supports three Annotations:

 

 

<! DOCTYPE html> <body> <? Php // This is a single line comment # this is also a single line comment/* This is a multi-line comment block it spans multiple lines */?> </Body> 

PHP case sensitive

In PHP, all user-defined functions, classes, and keywords (such as if, else, and echo) are case insensitive.

However, in PHP, all variables are case sensitive.

<!DOCTYPE html>
/* Only the first statement displays the value of the $ color variable.
Because $ color, $ COLOR, and $ coLOR are considered as three different variables */
</body> 

 

 

 


 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.