fork(2) download
  1. <?php
  2.  
  3. $json = '[{"gatewayId": "5154979870408704", "sensorId": "5698497110081536"}, {"timestamp": "20160513T225959000Z", "tagId": "123456789AB1", "io": "in"}, {"timestamp": "20160513T235959000Z", "tagId": "123456789AB2", "io": "out"}]';
  4. var_dump(json_decode($json, true));
Success #stdin #stdout 0.02s 52472KB
stdin
Standard input is empty
stdout
array(3) {
  [0]=>
  array(2) {
    ["gatewayId"]=>
    string(16) "5154979870408704"
    ["sensorId"]=>
    string(16) "5698497110081536"
  }
  [1]=>
  array(3) {
    ["timestamp"]=>
    string(19) "20160513T225959000Z"
    ["tagId"]=>
    string(12) "123456789AB1"
    ["io"]=>
    string(2) "in"
  }
  [2]=>
  array(3) {
    ["timestamp"]=>
    string(19) "20160513T235959000Z"
    ["tagId"]=>
    string(12) "123456789AB2"
    ["io"]=>
    string(3) "out"
  }
}