删除了嵌套数组php

时间:2014-04-16 01:56:06

标签: php arrays

我有一个

的数组
Array
(
    [0] => Array
        (
            [city_id] => 16
            [city_name] => San Diego
            [state_abbreviation] => CA
            [city_lat] => 32.715328
            [city_long] => -117.157257
            [city_image] => sandiego_ca.jpg
        )

)

我只想展示

 Array
            (
                [city_id] => 16
                [city_name] => San Diego
                [state_abbreviation] => CA
                [city_lat] => 32.715328
                [city_long] => -117.157257
                [city_image] => sandiego_ca.jpg
            )

基本上删除[0]嵌套,以便我可以更好地解析它

1 个答案:

答案 0 :(得分:0)

不是php数组可以这样做。只需使用tmp变量。

$ arr = $ this_arr [0];

就是这样。