Skip to content

Instantly share code, notes, and snippets.

@Fabax
Created August 30, 2013 06:55
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 Fabax/6386965 to your computer and use it in GitHub Desktop.
Save Fabax/6386965 to your computer and use it in GitHub Desktop.
turn string into json p
function echoJSON($data) {
$json = json_encode($data);
echo isset($_GET['callback'])
? "{$_GET['callback']}($json)"
: $json;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment