Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/242.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在php中提取对象中的对象数据?_Php_Arrays_Object - Fatal编程技术网

如何在php中提取对象中的对象数据?

如何在php中提取对象中的对象数据?,php,arrays,object,Php,Arrays,Object,我需要得到验证对象下有效的结果数据。此行[结果]=>string5有效。它似乎是一个对象中的一个对象,我找不到如何访问该对象中的数据的语法 object(EmailCheck\Object\ResponseObject)#25 (1) { ["response":protected]=> array(6) { ["status"]=> string(7) "success" ["total_results"]=> int(6)

我需要得到验证对象下有效的结果数据。此行[结果]=>string5有效。它似乎是一个对象中的一个对象,我找不到如何访问该对象中的数据的语法

object(EmailCheck\Object\ResponseObject)#25 (1) { 
    ["response":protected]=> array(6) { 
        ["status"]=> string(7) "success" 
        ["total_results"]=> int(6) 
        ["total_pages"]=> int(1) 
        ["query"]=> array(8) { 
            ["job_id"]=> int(2562625) 
            ["valids"]=> int(1) 
            ["invalids"]=> int(1) 
            ["disposables"]=> int(1) 
            ["catchalls"]=> int(1) 
            ["unknowns"]=> int(1) 
            ["page"]=> int(0) 
            ["items_per_page"]=> int(10) 
        } 
        ["results"]=> array(6) { 
            [0]=> array(2) {     
                ["data"]=> array(4) { 
                    ["email"]=> string(20) "chris@example.com" 
                    [0]=> string(1) "1" 
                    ["ID"]=> string(1) "1" 
                    ["EMAIL"]=> string(20) "chris@example.com" 
                    } 
                ["verification"]=> object(EmailCheck\Object\VerificationObject)#7 (1) { 
                    ["response":protected]=> array(7) { 
                        ["result"]=> string(5) "valid" 
                        ["flags"]=> array(3) { 
                            [0]=> string(7) "has_dns" 
                            [1]=> string(10) "has_dns_mx" 
                            [2]=> string(16) "smtp_connectable" 
                        } 
                ["suggested_correction"]=> string(0) "" 
                ["address_info"]=> object(EmailCheck\Object\ResponseObject)#9 (1) { 
                    ["response":protected]=> array(9) { 
                        ["original_email"]=> string(20) "chris@example.com" 
                        ["normalized_email"]=> string(20) "chris@example.com" 
                        ["addr"]=> string(6) "chris" 
                        ["alias"]=> string(0) "" ["host"]=> string(13) "example.com" 
                        ["fqdn"]=> string(13) "example.com" 
                        ["domain"]=> string(9) "example" 
                        ["subdomain"]=> string(0) "" 
                        ["tld"]=> string(3) "com" 
                    } 
                } 
                ["email"]=> string(20) "chris@example.com 
                ["result_integer"]=> int(0) 
                ["credits_info"]=> object(EmailCheck\Object\ResponseObject)#8 (1) { 
                    ["response":protected]=> array(0) { 
                } 
            } 
        } 
    } 
} 
我需要的数据在代码的这一部分:

["verification"]=> object(EmailCheck\Object\VerificationObject)#7 (1) { 
                ["response":protected]=> array(7) { 
                    ["result"]=> string(5) "valid" 
                    ["flags"]=> array(3) { 
                        [0]=> string(7) "has_dns" 
                        [1]=> string(10) "has_dns_mx" 
                        [2]=> string(16) "smtp_connectable" 
                    } 
我可以使用以下方法从数据中获取电子邮件:

$object->results[$counter]['data']['email']
我想出来了:

$object->results[$counter]['verification']->result

你能展示一下你的一些尝试吗?调整以前的解决方案不起作用吗$对象->结果[$counter][verification]->响应[result]不,这不起作用。我尝试过无数的变化。。。