我有一个已解码为此的 json 对象:
item_json:stdClass Object
(
[code] => 2013CA
[SP] => stdClass Object
(
[PID] => 1175630
[FirstName] => Kim
[LastName] => Kardashian
[DOB] => 01-02-1978
[Address1] => 12345 Kardashian Way
[Address2] =>
[Address3] =>
[City] => Hollywood
[State] => CA
[Zip] => 90210
[Country] => US
[Phone] => 1-210-5551212-
[Email] => kkardashian@kkardashian.com
[Info] => stdClass Object
(
[Declined] => null
[NameOnLicense] => KK
[State] => CA
[License] => 90210
[LicenseText] => License Number
[TypeID] => 215057
[Hours] => 24
[Units] => 24
[Price] => 0
)
)
)
如何测试 Info->Declined 是否为空?
我试过了
!isset($item_json-SP->Info->Declined)
和
$item_json-SP->Info->Declined == null
但他们都失败了。