mercredi 22 avril 2015

How do I get parameters from a PHP Object?

The object is contained in $response.

echo "<pre>";
 print_r($response);
echo "</pre>";

.. gives me the following:

Att\Api\Speech\SpeechResponse Object
(
   [_responseId:Att\Api\Speech\SpeechResponse:private] => f4119dcd51929c2dfae5e2d746c1d9a1
   [_status:Att\Api\Speech\SpeechResponse:private] => OK
   [_NBest:Att\Api\Speech\SpeechResponse:private] => Att\Api\Speech\NBest Object
        (
            [_hypothesis:Att\Api\Speech\NBest:private] => hi how are you
            [_languageId:Att\Api\Speech\NBest:private] => en-US
            [_confidence:Att\Api\Speech\NBest:private] => 0.5
            [_grade:Att\Api\Speech\NBest:private] => accept
            [_resultText:Att\Api\Speech\NBest:private] => Hi how are you.
            [_words:Att\Api\Speech\NBest:private] => Array
                (
                  [0] => Hi
                  [1] => how
                  [2] => are
                  [3] => you.
                )

            [_wordScores:Att\Api\Speech\NBest:private] => Array
                (
                  [0] => 0.33
                  [1] => 1
                  [2] => 1
                  [3] => 1
                )

        )

    )

N00b question: How would I now be able to receive the value from _resultText?

Aucun commentaire:

Enregistrer un commentaire