我有来自API Web服务的响应,我想获取此对象的值.示例:TimeStamp,TransactionID,SubscriptionResponse
并在HTML代码中显示此值不同的DIV.如何获得这个价值并使用主题?
来自API的回复:
object(SubscriptionResponseContainer)#11 (5) {
["Timestamp":protected]=> string(25) "2015-09-15T04:30:00+04:30"
["TransactionId":protected]=> string(10) "1445756101"
["SubscriptionResponse":protected]=> array(1) {
[0]=> object(SubscriptionResponseItemCollection)#12 (2) {
["Activate":protected]=> NULL
["Renew":protected]=> NULL
}
}
["SubscriptionError":protected]=> array(1) {
[0]=> object(SubscriptionResponseErrorCollection)#13 (2) {
["ActivateError":protected]=> array(1) {
[0]=> object(ResponseItemErrorType)#14 (4) {
["UnitId":protected]=> int(1)
["SubscriberId":protected]=> string(11) "09394354387"
["ErrorCode":protected]=> int(1)
["ErrorMessage":protected]=> string(70) "SubscriberId specified in the activate order was previously activated."
}
}
["RenewError":protected]=> NULL
}
}
["TransactionError":protected]=> NULL
}
Run Code Online (Sandbox Code Playgroud)
小智 0
例如:
$timestamp=$result['Timestamp'];
$TransactionID=$result['Timestamp']['TransactionID'];
Run Code Online (Sandbox Code Playgroud)