php - 从对象获取php数组
问题描述
我无法从对象中获取数组:
请在下面查看我的代码:
print_r($product_ser_id);
打印结果:
WHMCS\Service\Service Object
(
[table:protected] => tblhosting
[columnMap:protected] => Array
(
[clientId] => userid
[productId] => packageid
[serverId] => server
[registrationDate] => regdate
[paymentGateway] => paymentmethod
[status] => domainstatus
[promotionId] => promoid
[overrideAutoSuspend] => overideautosuspend
[overrideSuspendUntilDate] => overidesuspenduntil
[bandwidthUsage] => bwusage
[bandwidthLimit] => bwlimit
[lastUpdateDate] => lastupdate
[firstPaymentAmount] => firstpaymentamount
[recurringAmount] => amount
[recurringFee] => amount
)
}
在这里我必须从中获得价值[productId]
我已经测试为:$product_ser_id -> attributes:protected;
其显示错误为:
ParseError: syntax error, unexpected ':' in
我知道有很多例子,所以在你真正理解我的问题之前,请不要重复。
请帮忙
谢谢
解决方案
推荐阅读
- sql - VBA - SQL 查询数据库表到 Excel 表名中的特殊字符
- ios - Appsee 2.5.0 版本
- vue.js - 收到错误“错误:找不到相对于目录的预设“env””
- go - 责任链 - 当前失败时如何调用某个处理程序
- python - 向 xlwings Python 函数添加参数会使其崩溃
- php - 带计算字段的查询条件
- python - 缩写替换不止一次:iaw --> 按照 --> 输入按照
- javascript - 如何从javascript中array.map中的异步函数返回一个值?
- python - 向张量添加维度并沿新轴重复值
- google-cloud-platform - 在我的网络服务中随机拒绝