PHP variables, PHP variable _ PHP Tutorial

Source: Internet
Author: User
PHP variables. In PHP, the variable program in PHP is composed of two parts: code and data. data is stored in the variable. the essence of the variable is a storage space in the memory. Empty PHP variable corresponding to the variable, PHP variable
Variables in PHP

A program is composed of two parts: code and data. data is stored in variables. the essence of a variable is a storage space in memory. The space corresponding to the variable has a sub-name called the variable name, which is used to read and write data.

Variable definition

The '$' symbol must be used before the php variable name, or '$' is the syntax structure that defines the variable.

Example:

Variable access

Echo variable name;

Example:

Variable modification

Variable name = value;

Deletion of variables

Unset (variable name );

Example:

Variable naming rules:

1. it must start with '$'

2. only letters, numbers, and underscores are allowed.

3. the '$' symbol cannot start with a number.

Variable programs in PHP are composed of two parts: code and data. data is stored in variables. the essence of variables is a storage space in memory. Variable corresponding to null...

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.