How to make JSON POST request in PHP?

Guys, tell me please how to convert json array to normal? Php script POST method is passed a JSON with the following content:
{
"qqq":"www",
"eee":"rrr"
}

Adopted in your code like this:
$s = json_decode($_POST, true);
var_dump($s);

var_dump somehow produces NULL even though $s must contain a decoded array, am I right?
June 5th 19 at 22:01
2 answers
June 5th 19 at 22:03
Solution
Well, $_POST is probably what that field should be.
Or
$s = json_decode(file_get_contents('php://input'));

upd: Interesting to read on the subject
June 5th 19 at 22:05
The output of var_dump($_POST); in the Studio
Gives NULL - orion86 commented on June 5th 19 at 22:08
then, as noted below:
$s = json_decode(file_get_contents('php://input'));
- Ericka_Rutherfo commented on June 5th 19 at 22:11

Find more questions by tags JSONPHP