I have state list in JSON format and i am using json_decode function but when i am trying to access array values getting error.
$states='{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas"
}';
$stateList = json_decode($states);
echo $stateList['AL'];
Fatal error: Cannot use object of type stdClass as array on line 65