Help, Smarty Loop does not show
$arr =$_session["Mycar"];//take out a two-dimensional array from the SESSION
$smarty->assign ("arr", $arr);
{section name=a loop= $arr}
{$arr [A].pid}
{$arr [A].name}
{$arr [A].num}
Delete
{/section}
Print_r (arr) has data;
Array ([+] = = Array ([PID] + = [name] + glass coffee table [num] +-one) [+] = = Array ([PID] + [name] => ; fabric sofa [num] + 6) [+] = array ([PID] + [name] + [num] = 4) [+] = array ([PID] = [Nam E] = [num] = 6))
But there's only 4 lines in the table, and it doesn't show data.
------to solve the idea----------------------
{section name=a loop= $arr} It should be possible to delete the space after this line.
------to solve the idea----------------------
{ SectionName=a loop= $arr}
Requires the subscript of the array to start at 0
You error_reporting (E_all); You'll see the error message.
$smarty->assign ("arr", $arr);
Should write
$smarty->assign ("arr", Array_values ($arr));