Home > Backend Development > PHP Tutorial > 关于smarty取数组的有关问题

关于smarty取数组的有关问题

WBOY
Release: 2016-06-13 12:56:53
Original
845 people have browsed it

求助关于smarty取数组的问题
数组是这样的:
$array = Array ( [EMPNO] => 7369 [ENAME] => SMITH [JOB] => CLERK [MGR] => 7902 ) 

在模版里我这样写的:
{foreach key=key item=item from=$array}
   {$item.ename}
{/foreach}

可是为什么显示出来的是一个大写字母A呢?


------解决方案--------------------
你为什么不在php里处理好了再传给smarty呢,把所有ename的值取出来放入数组再传给smarty不就简单多了。
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