【发布时间】:2026-02-12 12:45:02
【问题描述】:
使用 PHP,我使用 print_r 打印出一个数组 ($result)。但是返回数组的格式对我来说是一个新格式。具体来说,当“reviews_review”(“哇,真棒……”)字段中的文本以这种具有多个值的特定格式找到时,如何检索它?示例:
stdClass Object
(
[node_reviews_nid] => 5270
[reviews_review] => a:2:{s:5:"value";s:38:"Wow, what a great place. The bestest!";s:6:"format";s:13:"filtered_html";}
那些额外的值和花括号让我很难过。如果我想要node_reviews_nid,我可以简单地使用 $result->node_reviews_nid" - 但是这样做来获取reviews_review 只会检索太多,即,
a:2:{s:5:"value";s:38:"Wow, what a great place. The bestest!";s:6:"format";s:13:"filtered_html";})
【问题讨论】: