how do I getting data from stdObject

40 views Asked by At
$cpanel = new cPanel('username','pass','domain');

$bandwidth_report = $cpanel->uapi(
        'Bandwidth', 'query',
        array(
            'grouping'        => "domain|year",
            'interval'        => 'daily',
            'protocols'       => 'http|imap|smtp',
            'timezone'        => 'America|Chicago',
            )
    );
var_dump($bandwidth_report);

I have the following output:

object(stdClass)#2 (6) { 
    ["messages"]=> NULL 
    ["status"]=> int(1) 
    ["metadata"]=> object(stdClass)#3 (0) { } 
    ["data"]=> object(stdClass)#5 (2) { 
                ["UNKNOWN"]=> object(stdClass)#4 (1) { 
                        ["1577836800"]=> int(27918) 
                } 
                ["chillberryconsulting.com"]=> object(stdClass)#6 (1) { 
                        ["1577836800"]=> int(36155409) 
                } 
    } 
    ["errors"]=> NULL ["warnings"]=> NULL 
}

The question is, I want to get the data from the "data" field in the result and echo it one by one in PHP.

0

There are 0 answers