Home >Backend Development >PHP Tutorial >Variables in PHP, PHP variables_PHP tutorial

Variables in PHP, PHP variables_PHP tutorial

WBOY
WBOYOriginal
2016-07-12 08:55:36826browse

Variables in PHP, PHP variables

Variables in PHP

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

Definition of variables

The '$' symbol must be used before the PHP variable name, which can also be understood as '$' is the grammatical structure for defining variables

Example:

Variable access

echo variable name;

Example:

Modification of variables

Variable name=value;

Deletion of variables

unset(variable name);

Example:

Naming convention for variables:

1. Must start with '$'

2. Can only contain letters, numbers, and underscores

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

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1116377.htmlTechArticleVariables in PHP, PHP variables Variable programs in PHP are composed of code and data. The data is stored in Variable, the essence of a variable is a storage space in memory. The empty space corresponding to the variable...
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