PHP----Learning Notes (i)

Source: Internet
Author: User
Tags http post uppercase letter alphanumeric characters

What is PHP:

PHP refers to PHP: Hypertext Preprocessor (Translator note: Php:hypertext preprocessor, recursive naming)

PHP is a server-side scripting language, similar to ASP

PHP scripts are executed on the server

PHP supports many databases

PHP is an open source software (open source Software,oss)

What is a PHP file:

PHP files can contain text, HTML tags, and scripts

PHP file returns pure HTML to the browser

The file suffix of the php file is ". php", ". PhP3", ". phtml"

PHP script block starts with <?php and ends with?>

Two basic instructions for entering text via PHP: Echo and print

All variables in PHP start with the $ symbol

Variable naming rules:

Variable names must begin with a letter or underscore "_"

Variable names can contain only alphanumeric characters and underscores

Variable names cannot contain spaces. If the variable name consists of multiple words, you should use an underscore to split it, or start with an uppercase letter.

The collocated operator.

Strlen () to calculate the length of a string

Strpos () to retrieve a string or a character within a string

To create a PHP function:

1, all functions use the keyword "function ()" to start

2. Named function-the name of the function should indicate its function. The function name begins with a letter or underscore.

3. Add "{"-the section after opening curly braces is the code of the function

4. Inserting function code

5. Add a "}"-the function ends by closing the curly braces.

$_get HTTP GET method

$_pos HTTP Post method

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.