Gettiing property values from stdClass in php

For example, print_r($result); shows the result below

stdClass Object
    [result] => stdClass Object
            [insertCount] => 0
            [updateCount] => 1
            [rejectedCount] => 0
            [totalCount] => 1
            [errorMessage] => 


The code below could get the property values of insertCount, updateCount, rejectedCount, totalCount and the errorMessage from the stdClass object.

echo $result->result->insertCount;
echo $result->result->updateCount;
echo $result->result->rejectedCount;
echo $result->result->totalCount;
echo $result->result->errorMessage;

Search within Codexpedia

Custom Search

Search the entire web

Custom Search