1
0

json.php 276 B

12345678910111213
  1. <?php
  2. error_reporting(0);
  3. if ( $_REQUEST['header'] ) {
  4. header("Content-type: application/json");
  5. }
  6. $json = $_REQUEST['json'];
  7. if($json) {
  8. echo '[ {"name": "John", "age": 21}, {"name": "Peter", "age": 25 } ]';
  9. } else {
  10. echo '{ "data": {"lang": "en", "length": 25} }';
  11. }
  12. ?>