Skip to content

Instantly share code, notes, and snippets.

@jsicot
Created February 19, 2014 09:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsicot/9088762 to your computer and use it in GitHub Desktop.
Save jsicot/9088762 to your computer and use it in GitHub Desktop.
<?php
$openurl = http_build_query($_GET, null, '&');
$url = 'http://airway.lib.hokudai.ac.jp/airway/openURL?'.$openurl ;
$airway = file_get_contents($url);
$airway = str_replace(array("\n", "\r", "\t", "jnl:"), '', $airway);
$airway = trim(str_replace('"', "'", $airway ));
$airway = simplexml_load_string($airway);
header('Content-Type: text/javascript; charset=utf8');
header('Access-Control-Allow-Methods: GET, POST');
$json= '(['.json_encode($airway).']);';
print_r($_GET['callback'].$json);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment