これはおそらく単純ですが、私は頭がおかしいです。
私はAPIを使用しています。$checkLead を宣言し、下に表示される stdClassObject を取得します。配列の値を取得しようとしています。この例では 1 つのレコードがありますが、将来はさらに多くのレコードが含まれる可能性があります。
これは、print_r を実行したときに出力されるものです。
stdClass Object (
[result] => stdClass Object (
[count] => 1
[leadRecordList] => stdClass Object (
[leadRecord] => stdClass Object (
[Id] => 26
[Email] => test3@test.com
[ForeignSysPersonId] =>
[ForeignSysType] =>
[leadAttributeList] => stdClass Object (
[attribute] => Array (
[0] => stdClass Object (
[attrName] => FirstName
[attrType] => string
[attrValue] => JJ
)
[1] => stdClass Object (
[attrName] => LastName
[attrType] => string
[attrValue] => JJ
)
[2] => stdClass Object (
[attrName] => Website
[attrType] => url
[attrValue] => test.com
)
)
)
)
)
)
)
複数の結果が返される例を次に示します。
stdClass Object (
[result] => stdClass Object (
[count] => 2
[leadRecordList] => stdClass Object (
[leadRecord] => Array (
[0] => stdClass Object (
[Id] => 33
[Email] => test3@test.com
[ForeignSysPersonId] =>
[ForeignSysType] =>
[leadAttributeList] => stdClass Object (
[attribute] => Array (
[0] => stdClass Object (
[attrName] => FirstName
[attrType] => string
[attrValue] => jj )
[1] => stdClass Object (
[attrName] => LastName
[attrType] => string
[attrValue] => amonit )
[2] => stdClass Object (
[attrName] => Website
[attrType] => url
[attrValue] => test.com )
)
)
)
[1] => stdClass Object (
[Id] => 26
[Email] => test3@test.com
[ForeignSysPersonId] =>
[ForeignSysType] =>
[leadAttributeList] => stdClass Object (
[attribute] => Array (
[0] => stdClass Object (
[attrName] => FirstName
[attrType] => string
[attrValue] => bob )
[1] => stdClass Object (
[attrName] => LastName
[attrType] => string
[attrValue] => smith )
[2] => stdClass Object (
[attrName] => Phone
[attrType] => phone
[attrValue] => 123-123-1234 )
[3] => stdClass Object (
[attrName] => Website
[attrType] => url
[attrValue] => test.com )
)
)
)
)
)
)
)
それで、誰かが の値を取得するのを手伝ってくれるかどうか疑問に思っていましたFirstName
。LastName
また、「が にFirstName
等しいの値は何ですか"JJ"
。