在PHP中获取stdclass和数组值

时间:2015-08-09 09:49:37

标签: php arrays stdclass

如何访问以下stdclass,并且已使用echo Transaction ID。

object(stdClass)#2 (1) {
  ["SendBulkSMS_PHPResult"]=>
  object(stdClass)#3 (1) {
    ["string"]=>
    array(3) {
      [0]=>
      string(1) "0"
      [1]=>
      string(37) "Transaction ID has already been used."
      [2]=>
      NULL
    }
  }
}

1 个答案:

答案 0 :(得分:0)

从它的外观来看,它将是:

$object->SendBulkSMS_PHPResult->string[1];