/ Published in: PHP
URL: http://pjotor.com
Tiny litter wrapper for returning stuff as a JSONP service.
Expand |
Embed | Plain Text
$service_callback = ($_REQUEST["callback"]) ? $_REQUEST["callback"] : false; $json = json_encode($data); return ($callback) ? "$callback(" . $json . ");" : $json; } //might be a nice thing to return the proper header e.g "header("HTTP/1.0 200 OK");"
You need to login to post a comment.
