Guest User

Untitled

a guest
Jul 20th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. curl http://localhost:80/problem2.php -X POST -H Content-Type:application/json --data-binary "{'cells': [4,8,11,18,19], 'distance': 2}"
  2.  
  3. $data = json_decode(file_get_contents('php://input'));
  4.  
  5. --data-binary '{"cells": [4,8,11,18,19], "distance": 2}'
  6.  
  7. var_dump(json_decode('{"cells": [4,8,11,18,19], "distance": 2}'));
  8.  
  9. print_r($data->cells);
  10.  
  11. Array
  12. (
  13. [0] => 4
  14. [1] => 8
  15. [2] => 11
  16. [3] => 18
  17. [4] => 19
  18. )
Add Comment
Please, Sign In to add comment