I receive this JSON string from another site and I cannot modify what received from. The string is receive in $_POST and is :
[
{
"clientId":"17295c59-4373-655a-1141-994aec1779dc",
"channel":"\/meta\/connect",
"connectionType":"long-polling",
"ext":{
"fm.ack":false,
"fm.sessionId":"22b0bdcf-4a35-62fc-3764-db4caeece44b"
},
"id":"5"
}
]
I decode the JSON string with the following code :
$receive = json_decode(file_get_contents('php://input'));
And when I use print_r($receive) I get the following:
Array (
[0] => stdClass Object
(
[clientId] => 17295c59-4373-655a-1141-994aec1779dc
[channel] => /meta/connect
[connectionType] => long-polling
[ext] => stdClass Object
(
[fm.ack] =>
[fm.sessionId] => 22b0bdcf-4a35-62fc-3764-db4caeece44b
)
[id] => 5
)
)
I can access and read all Array / Object with no problem :
$receive[$i]->clientId;
$receive[$i]->channel;
$connectionType = $receive[$i]->connectionType;
$receive[$i]->id;
$receive[$i]->ext->{'fm.sessionId'};
But {fm.ack} is empty
In the decoded JSON string, the false value is not between "".
Is it possible to access and read the false value and convert it into string value instead?
Thank you for your helping !
truein the JSON ?