diff options
Diffstat (limited to 'test/data/jsonp.php')
-rw-r--r-- | test/data/jsonp.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/data/jsonp.php b/test/data/jsonp.php new file mode 100644 index 000000000..6c13d72e9 --- /dev/null +++ b/test/data/jsonp.php @@ -0,0 +1,14 @@ +<?php +error_reporting(0); +$callback = $_REQUEST['callback']; +if ( ! $callback ) { + $callback = explode("?",end(explode("/",$_SERVER['REQUEST_URI']))); + $callback = $callback[0]; +} +$json = $_REQUEST['json']; +if($json) { + echo $callback . '([ {"name": "John", "age": 21}, {"name": "Peter", "age": 25 } ])'; +} else { + echo $callback . '({ "data": {"lang": "en", "length": 25} })'; +} +?> |