让我们首先查看许多PHP应用程序中的一项常用技术;将某些种类的信息存入程序开头的变量赋值语句中。
Let's start by looking at a common technique in many PHP applications: placing certain kinds of information in variable assignment statements at the top of the program.
例如你要写一句赋值语句,你可以声明任何类型的变量,在等号的左边使用任何标识符,然后在右边给出任何的表达式。
In writing an assignment statement, for example, you can declare variables of any type, use any identifier to the left of the equal sign, and supply any expression on the right.
变量赋值,比如set语句。
变量赋值 /SET语句
下面的步骤将创建这些变量并为其赋值,还将添加日志记录语句,以便了解在计算机运行时发生的情况。
The next steps will create and assign values to those variables along with a logging statement so you can see what is occurring as the machine runs.
元组赋值:一种赋值语句,等号右侧用一个序列,左侧为一个变量构成的元组。
An assignment with a sequence on the right side and a tuple of variables on the left.
变量是左值,因此可以出现在赋值语句的左边。数字字面值是右值,因此不能被赋值。给定以下变量。
Variables are lvalues and so may appear on the left-hand side of an assignment. Numeric literals are rvalues and so may not be assigned. Given the variables.
如果相应语句为某个表达式赋值,请用一个可写的变量、属性或数组元素替换该表达式。
If the statement assigns a value to an expression, replace the expression with a single writable variable, property, or array element.
变量声明时初始化优于赋值语句。
数组变量持有一个指针,它指向构成数组元素的数据及秩和长度信息,赋值语句仅复制此指针。
An array variable holds a pointer to the data constituting the array elements and the rank and length information, and an assignment copies only this pointer.
若要设置默认属性值,请在赋值语句左侧使用带有参数列表的变量名。
To set the default property value, use the variable name, with an argument list, on the left side of an assignment statement.
通过将变量名称置于赋值语句的左侧,可以在变量中存储值。
Use the variable name on the left side of an assignment statement.
通过将变量名称置于赋值语句的左侧,可以在变量中存储值。
Use the variable name on the left side of an assignment statement.
应用推荐