I want to serialise a date with the /
character in JSON, but I get this one escaped by a \
.
$a['0'] = '25/11';
echo json_encode($a); // ["25\\/11"]
and obviously i want to get ["25/11"]
I want to serialise a date with the /
character in JSON, but I get this one escaped by a \
.
$a['0'] = '25/11';
echo json_encode($a); // ["25\\/11"]
and obviously i want to get ["25/11"]
["25\/11"]
and ["25/11"]
are different representations of exactly the same data in JSON, so you (effectively) already have ["25/11"]
.
The solution then is: do nothing.