title: get json string into php variables
body: <p>I have the below code and what I am trying to do is get the json value from "total_reviews" into a php variable which we can call $total_reviews.</p>
  
  <p>however what is happening is i am getting an error that says</p>
  
  <pre><code>Notice: Undefined property: stdClass::$total_reviews
  </code></pre>
  
  <p>Here is my code
      
  
  <pre><code>//URL of targeted site  
  $url = "https://api.yotpo.com/products/$appkey/467/bottomline";  
  //  Initiate curl
  $ch = curl_init();
  
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_URL,$url);
  // Execute
  $result=curl_exec($ch);
  $data = json_decode($result);
  
  echo "e&lt;br /&gt;";
  echo $data-&gt;total_reviews; 
  
  
  // close curl resource, and free up system resources  
  curl_close($ch);  
  ?&gt;
  </code></pre>
  
  <p>If I print_r the result I have the below print out</p>
  
  <pre><code>{"status":{"code":200,"message":"OK"},"response":{"bottomline":{"average_score":4.2,"total_reviews":73}}}
  </code></pre>