如何从数组中的数组中获取值?

时间:2011-08-16 10:14:09

标签: php magento magento-1.4 magento-1.5

我在print_r($_POST)时收到此数组,从下面的结果我想获得skin的值。

[skin] => 1.jpg

我该怎么办?

 Array
    (
        [form_key] => WceDMPJOQD17ZeSW
        [config_state] => Array
            (
                [themeoptions_general] => 1
            )

        [groups] => Array
            (
                [general] => Array
                    (
                        [fields] => Array
                            (
                                [themeoptions_images] => Array
                                    (
                                        [skin] => 1.jpg
                                    )

                                [themeoptions_customcss] => Array
                                    (
                                        [value] => color:#333;
                                    )

                            )

                )

        )

)

2 个答案:

答案 0 :(得分:3)

$_POST['groups']['general']['fields']['themeoptions_images']['skin']

这将为您提供皮肤的价值。

答案 1 :(得分:0)

echo $_POST['groups']['general']['fields']['themeoptions_images']['skin']

打印

1.jpg