我試圖輸出數組的電子郵件值的值,但遇到問題。 陣列是基於json_decode()無法從數組中獲得值
這是錯誤我接收
Fatal error: Cannot use object of type stdClass as array in /home/.... line 57
JSON(的值函數:$ this-> bck_content)
{"email":"[email protected]","membership_id":"0","fname":"Kenneth","lname":"Poulsen","userlevel":"1","created":"2012-04-23 10:57:45","lastlogin":"2012-04-23 10:58:52","active":"y"}
我的代碼
# Display requested user details
$details_array = json_decode($this->bck_content);
$value = $details_array['email'];
print $value;
此代碼是否在類中執行? – 2012-04-25 18:00:27