2016-11-13 66 views
-2

如何從PHP中的JSON讀取值?我需要的用戶名,密碼和mandant->名稱值和縮寫從PHP中的JSON讀取值

感謝

data

+1

嘗試使用'json_decode()'函數;)http://php.net/manual/en/function.json-decode.php –

回答

0

感謝您的幫助。這是我的解決方案:

$json = $request->getContent(); 
    $arrayJson = json_decode($json, true); 
    $user = $arrayJson['user']; 
    $password = $arrayJson['password']; 
    $mandant = $arrayJson['mandant']; 
    $mandantName = $mandant('name'); 
    $mandantAbbr = $mandant('abbr');