You are building a REST API in PHP that receives JSON payloads. Which function correctly decodes the incoming request body into a PHP associative array?
-
A
json_decode(file_get_contents('php://input'), true)
-
B
json_decode($_POST['body'], true)
-
C
json_decode($_REQUEST['data'])
-
D
json_decode(file_get_contents('php://stdin'))