how to send multidimensional array post data in php?
<p>I"m setting up a mock for a service and trying to return some data to my callback page to save to a db table.</p>

<p>This is the code that I'm using to send the mock to the callback:</p>

<pre><code>function checkCallback(){

            $ch = curl_init("remote.domain.com/callback.php");

$jsonData = [


    "success" =&gt;true,      
    "error" =&gt; null, 
"response"=&gt; [
        "code"=&gt;"ad3f0db2-62b6-4cf4-9027-14829d33cfd2",
        "state"=&gt;"my-secret-state-123456789"
    ]

            ];

            $jsonDataEncoded = json_encode($jsonData);

            curl_setopt($ch, CURLOPT_POST, 1);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonDataEncoded);


            $result = curl_exec($ch);


            var_dump($result);
            echo $jsonDataEncoded;
              curl_close($ch);

}
</code></pre>

<p>callback.php:</p>

<pre><code>&lt;?php 


var_dump(get_defined_vars());

$un = 'username';
$pw = 'password';
$dsn = "mysql:host=localhost;port=3306;dbname=safelocal;charset=utf8";
$pdo_options = array(PDO::ATTR_EMULATE_PREPARES =&gt; false, 
                     PDO::ATTR_ERRMODE =&gt; PDO::ERRMODE_EXCEPTION);


$db = new PDO($dsn, $un, $pw, $pdo_options);



    $updateUserData = $db-&gt;prepare('INSERT into `table` (`message`, `extra`) VALUES(:msg, :extra)');
            $updateUserData-&gt;execute([
                ':msg' =&gt;$_POST["response"],
                ':extra' =&gt; $_POST["code"]
                                ]);
</code></pre>

<p>All I get back is a this strange response:</p>

<pre><code>myfile.php:77:string 'array(4) {
  ["_GET"]=&gt;
  array(0) {
  }
  ["_POST"]=&gt;
  array(1) {
    ["{"success":true,"error":null,"response":{"code":"ad3f0db2-62b6-4cf4-9027-14829d33cfd2","state":"my-secret-state-123456789"}}"]=&gt;
    string(0) ""
  }
  ["_COOKIE"]=&gt;
  array(0) {
  }
  ["_FILES"]=&gt;
  array(0) {
  }
}
' (length=291)
</code></pre>

<p>so we can see my data here, but how do we get it to act as key,value pairs so I can manipulate the data? Any guidance is appreciated.</p>