我想转换字符串:
{ "summonerLevel": 6, "name": "Nautilus", "dataVersion": 0, "internalName": "nautilus", "profileIconId": 4, "summonerId": 37399097, "acctId": 200656209, "revisionDate": "Sep 4, 2013 12:43:34 p.m.", "revisionId": 0 }
类似于:
$summonerLevel=6;
$name="Nautilus";
$dataVersion=0;
答案 0 :(得分:2)
只需解码字符串中的JSON,然后将其解压缩:
$vars = json_decode('{ ... }');
extract($vars);