{"message":{"@type":"response","@service":"naverservice.labs.api","@version":1.0.0,"result":{"translatedText":"I go to school.","srcLangType":"en"}
I would like to extract 'I go to school' from the result value received after API request When I use var_dump, it says string json_code, json decode is not allowed Please reply. <
php json
It's working Is there an error message?
$jsonString = '{"message":{"@type":"response":"@service":"naverservice.labs.api":"1.0.0","result":{"translatedText":"I go to school":"srcType":}
$object = json_decode($jsonString);
var_dump($object->message->result->translatedText); // string(24) "I go to school."
© 2024 OneMinuteCode. All rights reserved.