Guest User

Untitled

a guest
Jul 16th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. $ php -v
  2. PHP 5.3.2-1ubuntu4.5 with Suhosin-Patch (cli) (built: Sep 17 2010 13:41:55)
  3. Copyright (c) 1997-2009 The PHP Group
  4. Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
  5.  
  6. $ php -i | grep json
  7. json
  8. json support => enabled
  9. json version => 1.2.1
  10.  
  11. $ php json_test.php
  12. INPUT:
  13. [1,2,3]
  14. OUTPUT:
  15. array(3) {
  16. [0]=>
  17. int(1)
  18. [1]=>
  19. int(2)
  20. [2]=>
  21. int(3)
  22. }
  23.  
  24. INPUT:
  25. {"one":1,"two":2,"three":3}
  26. OUTPUT:
  27. object(stdClass)#1 (3) {
  28. ["one"]=>
  29. int(1)
  30. ["two"]=>
  31. int(2)
  32. ["three"]=>
  33. int(3)
  34. }
  35.  
  36. INPUT:
  37. "1"
  38. OUTPUT:
  39. string(1) "1"
  40.  
  41. INPUT:
  42. 1
  43. OUTPUT:
  44. int(1)
Add Comment
Please, Sign In to add comment