Home >Backend Development >PHP Tutorial > [难]在smarty模板中,上面的语句可能是什么意思

[难]在smarty模板中,上面的语句可能是什么意思

WBOY
WBOYOriginal
2016-06-13 13:00:05836browse

[难]在smarty模板中,下面的语句可能是什么意思?
A[b].c[d].e
------解决方案--------------------

<br />
<?php<br />
$arr = array(<br />
	'A[a]'=>array('C[d]'=>array('e'=>'hello world')),<br />
);<br />
print_r($arr);<br />
print_r($arr['A[a]']);<br />
<br />


没发现报错,你能把上下文给弄全了吗
------解决方案--------------------
<br />
$arr = array("a"=>array(1,2,3),"b"=>array("c"=>array("d"=>array("e"=>"Tom","f"=>"BeiJing"))));<br />
$smarty->assign("A",$arr);<br />
$smarty->display("testTwo.html");<br />

<br />
<!--testTwo.html--><br />
<br />
{$A['b'].c['d'].e}<br />
<!-- 输出Tom --><br />

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