use JSON; $decodejattch = $decoded2->{HasAttachments}; $decodejattch = JSON::decode_json $decodejattch;