Guest User

Untitled

a guest
Aug 10th, 2018
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. <?php
  2. $raw = file_get_contents('php://input');
  3. // echo $raw; username=potchara&password=1234
  4. parse_str($raw, $parsed);
  5. // echo json_encode($parsed); // {"username":"potchara", "password":"1234"}
  6. $data = json_encode($parsed);
  7. // $data will be json string
  8. $data = json_decode($data);
  9.  
  10. echo $data->password;
  11. ?>
Add Comment
Please, Sign In to add comment