3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str ='HTTP/1.1 200 OK Server: YYYYYYYYY Content-Type: application/json Content-Length: 163 X-OAPI-Request-Id: XXXXXXXXXXXXXX { "token_type": "berber", "access_token": "XXXXXXXXYYYYYYY", "expires_in": "7776000" }'; $arr = json_decode(substr($str,strpos($str,"{")), true); Var_dump($arr);

preferences:
39.25 ms | 402 KiB | 5 Q