国产chinesehdxxxx野外,国产av无码专区亚洲av琪琪,播放男人添女人下边视频,成人国产精品一区二区免费看,chinese丰满人妻videos

Smarty成員方法:appendByRef()

2018-10-20 11:19 更新

Name

appendByRef() — 引用追加

說明

void appendByRef(string varname,
                 mixed var,
                 bool merge);

和 append() 一樣,把值追加到數(shù)組,但以引用的方式來傳遞值。

技術(shù)說明

在PHP5中,appendByRef()在大部分時(shí)候都是沒有必要的。只當(dāng)你希望在模板中可以修改某個(gè)PHP數(shù)組的值,才有可能會使用到appendByRef(),當(dāng)然更好的方法是通過傳遞對象、改變對象的成員變量來達(dá)到目的。

Technical Note

The merge parameter respects array keys, so if you merge two numerically indexed arrays, they may overwrite each other or result in non-sequential keys. This is unlike the PHP array_merge()function which wipes out numerical keys and renumbers them.

Example 14.5. appendByRef()

<?php
// 追加鍵值對
$smarty->appendByRef('Name', $myname);
$smarty->appendByRef('Address', $address);
?>

參見 append()assign() 和 getTemplateVars().

以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號