Convert token string into array?

Hi,

Please help me convert this example token string.


{"access_token":"fet0eXAiOiJKV1QiLCJ5tKsxNvLpUW53W8jfYZXjo1tjcvS0x_XLd", "token_type":"urn:ietf:params:oauth:token-type:jwt","expires_in":35999,"refresh_token":null}

For readability the token above it looks like this,


{
	"access_token":"feyt0eXAiOiJKV1QiLCJ5tKsxNvLpUW53W8jfYZXjo1tjcvS0x_XLd",
	"token_type":"urn:ietf:params:oauth:token-type:jwt",
	"expires_in":35999,
	"refresh_token":null
}

into array, like this example below,


$array = array(
    "access_token" => "feyt0eXAiOiJKV1QiLCJ5tKsxNvLpUW53W8jfYZXjo1tjcvS0x_XLd",
    "token_type" => "urn:ietf:params:oauth:token-type:jwt",
    "expires_in" => 35999,
    "refresh_token" => "null",
);

Thanks in advance.

its a json format, use this function

 json_decode($string,true);