PHP json_decode – quote formatting

I’m trying to decode a json string with json_decode($str, false). But the format is not correct.

{mDetailedState:CONNECTED,mExtraInfo:3gnet,mIsAvailable:true,mIsFailover:false,mIsMetered:true,mIsRoaming:false,mNetworkType:0,mReason:connected,mState:CONNECTED,mSubtype:13,mSubtypeName:LTE,mTypeName:MOBILE,CREATOR:android.net.NetworkInfo$1@41bcdce,stateMap:{IDLE=DISCONNECTED,SCANNING=DISCONNECTED,CONNECTING=CONNECTING,AUTHENTICATING=CONNECTING,OBTAINING_IPADDR=CONNECTING,CONNECTED=CONNECTED,SUSPENDED=SUSPENDED,DISCONNECTING=DISCONNECTING,DISCONNECTED=DISCONNECTED,FAILED=DISCONNECTED,BLOCKED=DISCONNECTED,VERIFYING_POOR_LINK=CONNECTING,CAPTIVE_PORTAL_CHECK=CONNECTING},describeContents:0,getDetailedState:CONNECTED,getExtraInfo:3gnet,getReason:connected,getState:CONNECTED,getSubtype:13,getSubtypeName:LTE,getType:0,getTypeName:MOBILE,isAvailable:true,isConnected:true,isConnectedOrConnecting:true,isFailover:false,isMetered:true,isRoaming:false,toString:[type:MOBILE[LTE],state:CONNECTED/CONNECTED,reason:connected,extra:3gnet,failover:false,available:true,roaming:false,metered:true]}

I guess it is because of the quote issue.

For key, I can add the quote back by (reference)

$json = preg_replace('/([{,])(s*)([A-Za-z0-9_-]+?)s*:/','$1"$3":',$json);

The result will be

{"mDetailedState":CONNECTED,"mExtraInfo":3gnet,"mIsAvailable":true,"mIsFailover":false,"mIsMetered":true,"mIsRoaming":false,"mNetworkType":0,"mReason":connected,"mState":CONNECTED,"mSubtype":13,"mSubtypeName":LTE,"mTypeName":MOBILE,"CREATOR":android.net.NetworkInfo$1@41bcdce,"stateMap":{IDLE=DISCONNECTED,SCANNING=DISCONNECTED,CONNECTING=CONNECTING,AUTHENTICATING=CONNECTING,OBTAINING_IPADDR=CONNECTING,CONNECTED=CONNECTED,SUSPENDED=SUSPENDED,DISCONNECTING=DISCONNECTING,DISCONNECTED=DISCONNECTED,FAILED=DISCONNECTED,BLOCKED=DISCONNECTED,VERIFYING_POOR_LINK=CONNECTING,CAPTIVE_PORTAL_CHECK=CONNECTING},"describeContents":0,"getDetailedState":CONNECTED,"getExtraInfo":3gnet,"getReason":connected,"getState":CONNECTED,"getSubtype":13,"getSubtypeName":LTE,"getType":0,"getTypeName":MOBILE,"isAvailable":true,"isConnected":true,"isConnectedOrConnecting":true,"isFailover":false,"isMetered":true,"isRoaming":false,"toString":[type:MOBILE[LTE],"state":CONNECTED/CONNECTED,"reason":connected,"extra":3gnet,"failover":false,"available":true,"roaming":false,"metered":true]}

But, this function cannot add quote back to the value. I am not familiar with regex. Any reference I can refer in order to add the quote back to value or any idea I can convert the json to array easier? Thanks