fork download
  1. <?php
  2.  
  3. $json_string = '{
  4. "educations": {
  5. "_total": 7
  6. }
  7. }';
  8.  
  9. $decoded = json_decode($json_string);
  10. var_dump($decoded);
  11. $total= $decoded->educations->_total;
  12. echo PHP_EOL, $total;
  13.  
  14.  
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
object(stdClass)#1 (1) {
  ["educations"]=>
  object(stdClass)#2 (1) {
    ["_total"]=>
    int(7)
  }
}

7