【发布时间】:2014-12-11 11:09:17
【问题描述】:
这是我转储数组时的输出。我想要单个变量中的每个值。任何人都可以以表格形式提供帮助吗?它应该显示所有域,如 new.com(显示所有域)。
{
"Google-Yahoo": {
"com": "available",
"net": "notavailable"
"org": "notavailable"
},
"GoogleSite": {
"com": "available",
"net": "notavailable"
"org": "notavailable"
},
"Deal-Seek": {
"com": "available",
"net": "notavailable"
"org": "notavailable"
},
"Love-Seek": {
"com": "available",
"net": "available"
"org": "notavailable"
},
"True-Seek": {
"com": "available",
"net": "available"
"org": "notavailable"
}
}
【问题讨论】:
-
我试过
foreach($details as $domain){ echo $domain['com']."</br>"; echo $domain['net']."</br>"; echo $domain['org']."</br>"; foreach($domain as $new_array){ //echo $new_array; } } -
不是数组,是里面有对象的对象。即使您可以使用 foreach php.net/manual/es/language.oop5.iterations.php 使用 key=>value
标签: php arrays codeigniter