> 백엔드 개발 > PHP 튜토리얼 > 关于php读取数组的简单问题

关于php读取数组的简单问题

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
풀어 주다: 2016-06-20 12:39:49
원래의
957명이 탐색했습니다.

Array
(
    [state] => 1
    [data] => Array
        (
            [0] => Array
                (
                    [catid] => 105
                    [name] => 通知
                    [url] => http://www.xingan111.cn/jzxa/tongzhi/
                    [hasChildren] => 1
                )

            [1] => Array
                (
                    [catid] => 106
                    [name] => 新闻
                    [url] => http://www.xingan111.cn/jzxa/jzxanews/
                    [hasChildren] => 1
                )

            [2] => Array
                (
                    [catid] => 114
                    [name] => 社区
                    [url] => http://www.xingan111.cn/jzxa/jzxashequ/
                    [hasChildren] => 1
                )

            [3] => Array
                (
                    [catid] => 115
                    [name] => 公益
                    [url] => http://www.xingan111.cn/jzxa/jzxagongyi/
                    [hasChildren] => 1
                )

            [4] => Array
                (
                    [catid] => 116
                    [name] => 执法
                    [url] => http://www.xingan111.cn/jzxa/jzxazhifa/
                    [hasChildren] => 1
                )

            [5] => Array
                (
                    [catid] => 117
                    [name] => 政法
                    [url] => http://www.xingan111.cn/jzxa/jzxazhengfa/
                    [hasChildren] => 1
                )

            [6] => Array
                (
                    [catid] => 118
                    [name] => 便民
                    [url] =>http://www.xingan111.cn/jzxa/jzxabianmin/
                    [hasChildren] => 1
                )

            [7] => Array
                (
                    [catid] => 119
                    [name] => 美图
                    [url] => http://www.xingan111.cn/jzxa/jzxameitu/
                    [hasChildren] => 1
                )

        )

)


如上面的数组,我想将[catid] [name] [url] [hasChildren]对应的值都读出来(php方式),怎么做?


回复讨论(解决方案)

读到哪里?
既然您认为是 简单问题,那为何不自己解决呢?

我才开始学,但是这个问题应该用两个foreach就能遍历了吧

读到字符串里,我以前搞delphi,刚接触php。

编程不是凑代码!
你先要知道你想要什么样的结果,然后抱你的想法用计算机语言写出来

본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿