0

I would like to convert the string:

{ "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 }

Into something like :

$summonerLevel=6;
$name="Nautilus";
$dataVersion=0;

1 Answer 1

2

Just decode the JSON in your string, and then extract it:

$vars = json_decode('{ ... }');
extract($vars);
Sign up to request clarification or add additional context in comments.

1 Comment

thanks a lot ! just added true to json_decode to make it work. $vars = json_decode('{ ... }',true); extract($vars);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.