?
This document uses PHP Chinese website manual Release
void assign_by_ref
(string
varname, mixed var)
This is used to assign values to the templates by reference instead
of making a copy. See the PHP manual on variable referencing for an
explanation.
采用引用的方式賦值到模板中,而不是在模板中創(chuàng)建一個(gè)數(shù)值的副本。引用的概念可以查看PHP手冊(cè)的變量引用部分。
Technical Note: This is used to assign values to the templates by reference. If you assign a variable by reference then change its value, the assigned value sees the change as well. For objects, assign_by_ref() also avoids an in-memory copy of the assigned object. See the PHP manual on variable referencing for an in-depth explanation.
注意:本函數(shù)用于采用引用的方式賦值到模板中。如果把一個(gè) 變量采用引用的方式賦值后,變量的值又被改變了,那么在模板中將會(huì)看到變量改變后的值。對(duì)于對(duì)象,assign_by_ref()函數(shù)也避免了對(duì)象的內(nèi)存 拷貝。進(jìn)一步的解釋可以查看PHP手冊(cè)的變量引用部分。
Example 13-4. assign_by_ref
|