I have an issue with a json string.
I send this json string in Postman,
{
"places": [
{
"longitude": "79.9304633",
"latitude": "6.720229199999999",
"city": "Panadura"
},
{
"longitude": "79.86296829999999",
"latitude": "6.855948499999999",
"city": "Dehiwala"
}
]
}
But in the server side, when I get this value using this,
$jsonPlaces = $_POST['jsonplaces'];
and the value of $jsonPlaces looks like this,
{\\\"places\\\":[{\\\"longitude\\\":\\\"79.9304633\\\",\\\"latitude\\\":\\\"6.720229199999999\\\",\\\"city\\\":\\\"Panadura\\\"},{\\\"longitude\\\":\\\"79.86296829999999\\\",\\\"latitude\\\":\\\"6.855948499999999\\\",\\\"city\\\":\\\"Dehiwala\\\"}]}
therefore json_encode() function doesn't work for the above string since json syntax is changed. How to fix this issue?
Thanks
stripslashes($_POST['jsonplaces'])