monkeymatrix monkeymatrix - 1 year ago 86
PHP Question

Convert a Hashmap string into an array using PHP

I am using an API which returns data as a string in the following format:


I want to put this result in to a multi-dimensional PHP array, but since the input is a string, I can't think of a convenient way to convert this.

Is there a function that can automatically parse this data into an array as desired?


That's JSON, simple enough:

$array = json_decode($string, true);


    [] => Array
            [status] => available
            [classkey] => domcno