neilfurry Posted November 7, 2015 Share Posted November 7, 2015 hi mate, i have this json output and i need this to be in php array how can i do this, events : [ {'id':1, 'start': new Date(year, month, day, 12), 'end': new Date(year, month, day, 13, 00), 'title': 'Lunch with Sarah', userId: [1, 2]}, {'id':2, 'start': new Date(year, month, day, 14), 'end': new Date(year, month, day, 14, 40), 'title': 'Team Meeting', userId: 0}, ],free: [ {'start': new Date(year, month, day-1, , 'end': new Date(year, month, day-1, 18), 'free': true, userId: [0,1,2,3]}, {'start': new Date(year, month, day, , 'end': new Date(year, month, day+0, 18), 'free': true, userId: [0,1,2,3]}, ] Thanks in advance Link to comment https://forums.phpfreaks.com/topic/299320-json-to-php-array/ Share on other sites More sharing options...
benanamen Posted November 7, 2015 Share Posted November 7, 2015 Your Json is not valid. $json='{ "glossary":{ "title":"example glossary", "GlossDiv":{ "title":"S", "GlossList":{ "GlossEntry":{ "ID":"SGML", "SortAs":"SGML", "GlossTerm":"Standard Generalized Markup Language", "Acronym":"SGML", "Abbrev":"ISO 8879:1986", "GlossDef":{ "para":"A meta-markup language, used to create markup languages such as DocBook.", "GlossSeeAlso":[ "GML", "XML" ] }, "GlossSee":"markup" } } } } }'; $array = json_decode($json, TRUE); print_r($array); Link to comment https://forums.phpfreaks.com/topic/299320-json-to-php-array/#findComment-1525872 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.