你好,我想从多维数组中获取单个值。到目前为止我已经完成了这个
print_r($result);
并输出如下
Array (
[All Nodes Are Shuddha] => stdClass Object (
[answer] => All Nodes Are Shuddha
)
)
请告诉我如何只有“ÄllNodesshudhha”
答案 0 :(得分:0)
也许:
echo $result['All Nodes Are Shuddha']->answer;
答案 1 :(得分:0)
请将对象转换为数组,将其用作以下内容。
$arr = (array) $result['Äll Nodes are shudhha'];
print_R($arr['answer']);
答案 2 :(得分:0)
foreach($result as $key => $values) {
echo $key; // this should get the key 'All Nodes Are Shuddha'
}