Skip to content

Instantly share code, notes, and snippets.

@rexxars
Created November 7, 2014 14:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rexxars/452a936fcc428273ae2c to your computer and use it in GitHub Desktop.
Save rexxars/452a936fcc428273ae2c to your computer and use it in GitHub Desktop.
<?php
$postData = array(); // Fill this with your JSON/JS
$context = stream_context_create(array(
'http' => array(
'method' => 'POST',
'header' => 'Content-Type: application/json'. "\r\n",
'content' => json_encode($postData)
)
));
$chart = file_get_contents('http://highcharts.some.host:11942/', false, $context);
file_put_contents(__DIR__ . '/output/chart.png', $chart);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment