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

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

WBOY
Release: 2016-06-13 13:00:05
Original
829 people have browsed it

[难]在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 />
Copy after login


没发现报错,你能把上下文给弄全了吗
------解决方案--------------------
<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 />
Copy after login

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template