Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $raw = file_get_contents('php://input');
- // echo $raw; username=potchara&password=1234
- parse_str($raw, $parsed);
- // echo json_encode($parsed); // {"username":"potchara", "password":"1234"}
- $data = json_encode($parsed);
- // $data will be json string
- $data = json_decode($data);
- echo $data->password;
- ?>
Add Comment
Please, Sign In to add comment