0

My server adds slashes in cookie value. Please help me to off this.

current cookie value is like this,

{\"pId\":\"7\",\"unit\":\"1\",\"uniqueId\":1430215177,\"color\":\"\",\"size\":\"\"}

But I want it to be like this,

{"pId":"7","unit":"1","uniqueId":1430215943,"color":"","size":""} 
Dushyant Joshi
  • 3,672
  • 3
  • 28
  • 52

1 Answers1

0

You can use stripslashes function available in php like this :

$jsonString = " {\"pId\":\"7\",\"unit\":\"1\",\"uniqueId\":1430215177,\"color\":\"\",\"size\":\"\"}"
stripslashes($jsonString);
chandresh_cool
  • 11,753
  • 3
  • 30
  • 45