Home > Backend Development > PHP Tutorial > php 如何读取这些数据呢??

php 如何读取这些数据呢??

WBOY
Release: 2016-06-23 14:18:09
Original
977 people have browsed it

以下内容是,print_r  出来的数据,、
如何 将[listing] => Array() 下的数据,循环读出来??





Array
(
    [status] => 1
    [info] => 
    [data] => Array
        (
            [user_info] => Array
                (
                    [uid] => 1
                    [id] => 1
                    [fuid] => 0
                    [fuids] => 0
                    [gid] => 1
                    [user] => admin
                    [password] => dd8eb031789b6a0664709455e7d512ce
                    [api_password] => dd8eb031789b6a0664709455e7d512ce
                    [status] => 1
                    [sort] => 0
                    [dateline] => 1291190509
                    [question] => 0
                    [hash_answer] => 
                    [domains] => xxx.com *.xxx.com
                    [address] => XX省XX市XX区XX街XX号
                    [company_name] => 自己的路
                    [company_address] => XX市XX路XX楼XX号
                    [company_tel] => 02088888888
                    [company_website] => http://www.xxx.com
                    [truename] => 李某张三
                    [card_number] => 4088***************
                    [email] => 111111111@qq.com
                    [qq] => 000000
                    [description] => 注释
                    [balance] => 0
                    [groupId] => 1
                    [groupName] => 超级管理员
                    [limits] => sys_admin
                    [suids] => 1
                    [sys_admin] => 1
                )

            [begin_time] => 1375598513.55
            [timestamp] => 1375598513
            [is_login_module] => 1
            [mc] => 25237417b6e0a1fbd6
            [module_js_exists] => 1
            [ftp_root_wrong] => 0
            [aName] => FTP列表
            [page] => 2 条记录 1/1 页       
            [listing] => Array
                (
                    [0] => Array
                        (
                            [id] => 1
                            [uid] => 1
                            [order_id] => 0
                            [sid] => 1
                            [name] => zzcms_com
                            [password] => 6a2c8224f080958ac4d7ef7d8673effd
                            [dateline] => 1371426776
                            [dateline_update] => 1375596219
                            [status] => 1
                            [sort] => 2000
                            [dir] => /home/xxx_com-20130617-hQP/
                            [master] => 0
                            [description] => 
                            [user] => zijidelu
                            [user_email] => service@zijidelu.org
                            [total_size] => 0
                            [solutions_name] => 旗舰套餐
                            [ftp_DLBandwidth] => 0
                            [ftp_ULBandwidth] => 0
                            [ftp_QuotaSize] => 0
                            [ftp_QuotaFiles] => 0
                            [ftp_count] => 0
                        )

                    [1] => Array
                        (
                            [id] => 2
                            [uid] => 1
                            [order_id] => 0
                            [sid] => 1
                            [name] => zijidelu
                            [password] => WiSTbUcfWUqdBiovKOYMEDeqPuOPMezh
                            [dateline] => 1371426777
                            [dateline_update] => 1371426777
                            [status] => 1
                            [sort] => 2000
                            [dir] => /home/xxx_com-20130617-hQP/
                            [master] => 1
                            [description] => 
                            [user] => zijidelu
                            [user_email] => service@zijidelu.org
                            [total_size] => 0
                            [solutions_name] => 旗舰套餐
                            [ftp_DLBandwidth] => 0
                            [ftp_ULBandwidth] => 0
                            [ftp_QuotaSize] => 0
                            [ftp_QuotaFiles] => 0
                            [ftp_count] => 0
                        )
                        
                    [2] => Array
                        (
                            [id] => 3
                            [uid] => 1
                            [order_id] => 0
                            [sid] => 1
                            [name] => zijidelu
                            [password] => WiSTbUcfWUqdBiovKOYMEDeqPuOPMezh
                            [dateline] => 1371426777
                            [dateline_update] => 1371426777
                            [status] => 1
                            [sort] => 2000
                            [dir] => /home/xxx_com-20130617-hQP/
                            [master] => 1
                            [description] => 
                            [user] => zijidelu
                            [user_email] => service@zijidelu.org
                            [total_size] => 0
                            [solutions_name] => 旗舰套餐
                            [ftp_DLBandwidth] => 0
                            [ftp_ULBandwidth] => 0
                            [ftp_QuotaSize] => 0
                            [ftp_QuotaFiles] => 0
                            [ftp_count] => 0
                        )

                )

            [total_run_time] => 9.818 s
        )

)


回复讨论(解决方案)

foreach($arr['data']['listing'] as $vl){     foreach($vl as $k=>$v) echo $k.'=>'.$v.'<br>';}
Copy after login

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template