I cant get one value from object

hello

I did API Request for THETA Camera with php language and that was working :

code :

error_reporting(E_ALL); 
  ini_set( 'display_errors','1');
  
  $url ="http://192.168.254.124/osc/commands/execute";
  $username = 'THETAYN10113693';
  $password = '10113693';
 // $parameters json_encode(array("fileType" => "image", "entryCount" => 1, "maxThumbSize" => 0));
  $Body = json_encode(array('name' => 'camera.listFiles', 'parameters' => array("fileType" => "image", "entryCount" => 1, "maxThumbSize" => 0)));
  $options = array(
          CURLOPT_URL            => $url,
          //CURLOPT_HEADER         => true,
          CURLOPT_VERBOSE        => true,
          CURLOPT_RETURNTRANSFER => true,
          CURLOPT_FOLLOWLOCATION => true,
          CURLOPT_SSL_VERIFYPEER => false,    // for https
          CURLOPT_USERPWD        => $username . ":" . $password,
          CURLOPT_HTTPAUTH       => CURLAUTH_DIGEST,
          CURLOPT_POST           => true,
          CURLOPT_HTTPHEADER     => array('Content-Type:application/json'),
          CURLOPT_POSTFIELDS     => $Body
     
  );
  
  $ch = curl_init();
  
  curl_setopt_array( $ch, $options );
  
  $raw_response  = curl_exec( $ch );

 // echo json_encode($raw_response);  
 //$total_data = json_encode($raw_response);



echo $raw_response;
 //echo $total_data;

and i got this Response :

{“fingerprint”:“FIG_0163”,“state”:{"_apiVersion":2,“batteryLevel”:0.78,"_batteryState":“disconnect”,"_cameraError":[],"_captureStatus":“idle”,"_capturedPictures":0,"_compositeShootingElapsedTime":0,"_function":“mySetting”,"_latestFileUrl":“http://192.168.254.124/files/90014a68423861503e031db848764600/100RICOH/R0011105.JPG","_mySettingChanged":false,"_pluginRunning":false,"_pluginWebServer":true,"_recordableTime":0,"_recordedTime":0,“storageUri”:"http://192.168.254.124/files/90014a68423861503e031db848764600/”}}


I want only one value from this object i want Url Picture To be able to download the image

but i cant got any single value from this object Always got only Undefine 

I tried also $raw_response.state._latestFileUrl also not work ??

I dont know how can I handle with this object???

i hope help

The response from the camera is JSON. I am not familiar with PHP. How do you convert JSON into PHP objects? Should you use json_decode instead of json_encode to convert a JSON string into a PHP data type?

From a quick web search, I see this.
PHP: json_decode - Manual

Here’s an example with Dart. If the HTTP response is 200, then I decode the JSON string into a Dart Object and then am able to extract the fileUrl.

      if (response.statusCode == 200) {
        var responseBody = jsonDecode(response.body);
        // thumbnail is base64 encoded
        var thumb64 = responseBody['results']['entries'][0]['thumbnail'];
        String fileUrl = responseBody['results']['entries'][0]['fileUrl'];
        String name = responseBody['results']['entries'][0]['name'];

I find that using this site helps with testing.

You can simulate image lists with this

https://picsum.photos/v2/list

i want way to handle this object in Php or in java Script normsl both is work

The response from the camera is a standard JSON string. Do you have code to convert a standard JSON string into PHP?

Can you extract the JSON values from another service like this?

https://jsonplaceholder.typicode.com/