DynamoDB json output

DynamoDB json output

Hi,

I am using below to get gender list from DynamoDB:

  1. $result = $client->scan(array(
  2.     'TableName' => 'gender',
  3. ));

  4. foreach ($result['Items'] as $item) {      
  5.     echo json_encode($item);
  6. }

and getting this output:

  1. {"gender_name":{"S":"Female"},"gender_id":{"S":"F"}}{"gender_name":{"S":"Male"},"gender_id":{"S":"M"}}

if data is my returned in ajax success, how can I get the gender_id and gender_name?


Thanks,