title: php to highchart, how to send the right array?
body: <p>I made this code with:</p>
  
  <p><a href="https://github.com/influxdata/influxdb-php" rel="nofollow noreferrer">https://github.com/influxdata/influxdb-php</a></p>
  
  <p><a href="https://www.highcharts.com/docs/working-with-data/live-data" rel="nofollow noreferrer">https://www.highcharts.com/docs/working-with-data/live-data</a></p>
  
  <pre><code>&lt;?php 
  include('/opt/lampp/htdocs/example/vendor/autoload.php');
  
  $host = '127.0.0.1';
  $port = 8086;
  $dbname = 'aTimeSeries';
  
  /*
  $client = new \InfluxDB\Client($host, $port);
  
  $database = $client-&gt;selectDB('aTimeSeries');
  */
  
  //the exact same thing
  $database = \InfluxDB\Client::fromDSN(sprintf('influxdb://user:pass@%s:%s/%s', $host, $port, $dbname));
  
  //query of the last value
  $result = $database-&gt;query('select * from valeurs group by * order by desc limit 1');
  
  //recup le point
  $points = $result-&gt;getPoints();
  
  // Set the JSON header
  header("Content-type: application/json");
  
  // The x value is the current JavaScript time, which is the Unix time multiplied by 1000.
  $x = time() * 1000;
  // The y value is a random number
  //$y = rand(0,100);
  $y = $points;
  
  // Create a PHP array and echo it as JSON
  $ret = array($x, $y);
  echo json_encode($ret);
  
  ?&gt;
  </code></pre>
  
  <p><strong>Output:</strong> </p>
  
  <p><code>[1523603506000,[{"time":"2018-04-13T07:11:45.208943754Z","value":48}]]</code></p>
  
  <p>But I would like this: </p>
  
  <pre><code>[1523603506000,48]
  </code></pre>
  
  <p>Or this:</p>
  
  <pre><code>[2018-04-13T07:11:45.208943754Z,48]
  </code></pre>
  
  <p>If I try to output <code>$points</code> only, I got only the last part of the array, but it is not what I would like either.</p>
  
  <p>PS: if you have a better solution to do the same thing, maybe with nodeJS, I will surely listen</p>