如何在Smarty模板文件中获取此数组的值?

时间:2012-11-29 11:55:30

标签: php smarty


From smarty Tpl how to retrieve the array values.

Array
(
    [0] => Array
        (
            [0] => Array
                (
                    [ques_id] => 45
                    [optid1] => 234
                    [optid2] => 235
                    [optid3] => 236
                    [optid4] => 237
                    [optans1] => Unlimited personal and business liability
                    [optans2] => Company profits and shareholder earnings are taxed (double taxation)
                    [optans3] => Difficult to raise capital from investors
                    [optans4] => Income flows through personal tax returns
                    [optcount1] => 10
                    [optcount2] => 26
                    [optcount3] => 19
                    [optcount4] => 4
                    [answer] => 235
                    [count] => 4
                )

        )

    [1] => Array
        (
            [Difficult to raise capital from investors] => 19
            [Unlimited personal and business liability] => 10
            [Income flows through personal tax returns] => 4
        )

    [2] => Array
        (
            [Company profits and shareholder earnings are taxed (double taxation)] => 26
        )

)

这里如何获得 [公司利润和股东收入纳税(双重征税)] => 26 来自smarty中的这个数组。

1 个答案:

答案 0 :(得分:1)

$arrayName[0][0].optans1应该为您提供“无限的个人和商业责任”