How to remove all double quotes from json key values using php? -


i got json data. want remove double quotes json keys able parse data want. current code works if there no double quote on key there double quote in key code doesn't parse json data! 1 tell me how fix problem.thanks

$code = stripslashes($_post['outputtext']); $data = json_decode($code, false);   foreach($data->videos $item) {     echo "<br>id: ".$item->id . "\n";    echo "<br>title: ".$item->title . "\n";    echo "<br>url: ".$item->url . "\n";    echo "<br>img: ".$item->img . "\n";    echo "<br>img: ".$item->description . "\n";    echo "<br>";  } 

json data:

{    "cat":{       "id":"1234567",       "source_id":null,       "title_en":"first season",       "description_en":"this spring category "    },    "videos":[       {          "id":"312412343",          "url":"\/2015-07-17\/1abcd.mp4",          "img":"image\/44\/\/2015-07-17\/1abcd.jpg",          "title":"first "title" here",          "description":"some text" description "here "       },       {          "id":"2342343",          "url":"\/2015-07-16\/2dcdeg.mp4",          "img":"images\/44\/\/2015-07-16\/2dcdeg.jpg",          "title":"second "title "here",          "description":"some text" description "here "       }    ] } 


Comments