我是搞java的,但现在边学边用php的,找不到资料说明这个&符号用法说明,谢谢
例如:
function & getDBO()
{
return $this->dbo;
}
$tableTags =& $tablePosts->getLinkTable('tags');
$tableComments =& FLEA::getSingleton('Table_Comments');
我是搞java的,但现在边学边用php的,找不到资料说明这个&符号用法说明,谢谢
例如:
function & getDBO()
{
return $this->dbo;
}
$tableTags =& $tablePosts->getLinkTable('tags');
$tableComments =& FLEA::getSingleton('Table_Comments');
表示引用,
就是句柄,但是一般php5用的就不多了。遍历数组时仍会用到,
[code="php"]
foreach ($arr as &$value) {
$value['name'] = trim($value['name']);
}
[/code]
数组不用还不行。