我需要什麼:在鍵值對對於每個循環不是在PHP
- 問題IM即時通訊面臨的不是數據。
這裏是我的代碼
$ =元json_decode($元,真);
它輸出ME陣列
Array
(
[name] => Yogender
[email] => [email protected]
[designation] => Business Manager
[website] =>
[phone] => 91-92
[company] => Veer Signages Pvt. Ltd.
[city] => Gurgaon
[country] => India
)
Array
(
[name] => Prakash Tiwari
[email] => digital
[designation] => Director
[website] =>
[phone] => 91-981
[company] => Digital Semiconductors Pvt. Ltd
[city] => New Delhi
[country] => India
)
IM使用foreach循環讀取該數組
foreach($metadata as $key=>$value) { echo $value['name']; }
它陣列的輸出第一串
output yB9VGI PdD9DNI
我只是想至在關鍵值對中獲取['指定'] & ['company']。 像
[designation] => manager [company]=>google
,請告訴我,我錯了什麼意見或建議者居多。
試試這個:echo $ value-> name;並看看會發生什麼? – Pundit 2014-09-11 11:15:50
嘗試$ metadata ['company']和$ metadata ['designation']也有你在$ metadata中的一個數組一次或多個數組 – 2014-09-11 11:16:41
不,它不輸出東西 – 2014-09-11 11:17:29