Q:

Get json string elements

I am using a astrology API which sends an json string as response to the query.  But i have been trying for long to convert it into json and retrieve different items from the response string.  Here is the example of the response:
{"ashtakoota":{"status":true,"received_points":26},"manglik":{"status":true,"male_percentage":13.25,"female_percentage":13.75},"rajju_dosha":{"status":false},"vedha_dosha":{"status":false},"conclusion":{"match_report":"Marriage between the prospective bride and groom is highly recommended.  The couple would have a long-lasting relationship, which would be filled with happiness and affluence."}} 

I am using php script so i tried the following code :
$json = json_decode($res1, true);
 TRY 1 --> echo array_values($json[1]);
 TRY 2 --> echo $json.ashtakoota.status;
 TRY 3 --> echo $res1.ashtakoota.status;
But the output is always blank.  I doubt that $json is empty or the json response is not perfectly json. 

A:

PHP uses string keys for its arrays, which is what json_decode(...) returns.  As such, you need to access them as:
echo $json['ashtakoota']['status'];

Which should then output true for your example JSON input.