I am trying to use a JSON decoder to get some information, but it doesnβt work, it just shows the data as null when I use var_dump
Here is the JSON format data passed in URL
orderSummary={"orderInfo":[{"itemNumber":"1","quantity":"3","price":"5.99","productName":"Item_B"}]}
When I just repeat the jagged line, I get the following
echo $_GET['orderSummary'];
However, when I try to decode it, the result is null
$order = $_GET['orderSummary']; $data = json_decode($order,true); echo "<PRE>"; var_dump($data); die();
Is it formatted correctly?
source share