$row2=explode('______',$conne->getRowsArray($sql));
$smarty->assign(array("array3"=>$row,"array4"=>$row2));在此定义了数组
{%foreach item=i from=$array3%}
{%foreach item=j from=$array4%}//这里开始循环array,在这样里怎么才可以循环出数组的内容。
{%if $i!="guid"%}
<tr bgcolor="#EAEFFC">
<td height="22" align="center">{%$i|replace:"__":" "%}</td>
<td height="22" align="left">
<input name="{%$i%}" type="text" id="{%$i%}" value="{%$j[0]%}" style="width:200px;" ><font color="#FCB4A5">(中文)</font> <input name="{%$i%}2" type="text" id="{%$i%}2" style="width:200px;" ><font color="#FCB4A5">(ENGLISH)</font>
</td>
</tr>
{%/if%}
{%/foreach%}
{%/foreach%}
$smarty->assign(array("array3"=>$row,"array4"=>$row2));在此定义了数组
{%foreach item=i from=$array3%}
{%foreach item=j from=$array4%}//这里开始循环array,在这样里怎么才可以循环出数组的内容。
{%if $i!="guid"%}
<tr bgcolor="#EAEFFC">
<td height="22" align="center">{%$i|replace:"__":" "%}</td>
<td height="22" align="left">
<input name="{%$i%}" type="text" id="{%$i%}" value="{%$j[0]%}" style="width:200px;" ><font color="#FCB4A5">(中文)</font> <input name="{%$i%}2" type="text" id="{%$i%}2" style="width:200px;" ><font color="#FCB4A5">(ENGLISH)</font>
</td>
</tr>
{%/if%}
{%/foreach%}
{%/foreach%}
(
[0] => Array
)竟然是空的
(
[0] => Array
(
[guid] => 0730FFC0-7407-478D-3CA9-8395B8A9D567
[品牌_Brand] => 惠普______hp
[颜色_colors] => 金属材质 银灰色______Silver metal
[平台_Platform] => Intel______Intel
[CPU类型_CPU__Type] => 酷睿双核i3处理器______I3 Core Duo processor
[CPU型号_CPU__Type] => i3-2310M______i3-2310M
[硬盘容量_Hard__disk__capacity] => 500GB______500GB
[显示芯片_Graphics__chips] => Intel HD3000______Intel HD3000
[内存容量_Memory__capacity] => 2GB______2GB
))
{% $j[0].guid %}这样,其他的一样,要多研究现,要多练习,那样很容易就找到规律了
是{% $j.guid %}