how convert this string json PHP -


i have following string

[[[2401263,"chelsea","everton",1,"2013-05-19t15:00:00.0000000",[[4977131,39]],1,1,1,[1,30,"2013-05-19t15:00:48.4400000",0],17,"/sports/soccer/england_premier_league",,],[2401266,"newcastle","arsenal",1,"2013-05-19t15:00:00.0000000",[[4977137,39]],0,0,1,[1,90,"2013-05-19t15:01:10.8430000",0,0,0],18,"/sports/soccer/england_premier_league",0,0],[2401267,"southampton","stoke city",1,"2013-05-19t15:00:00.0000000",[[4977139,39]],0,0,1,[1,180,"2013-05-19t15:02:56.8230000",0,0,0],18,"/sports/soccer/england_premier_league",0,0],[2401269,"tottenham","sunderland",1,"2013-05-19t15:00:00.0000000",[[4977143,39]],0,0,1,[1,30,"2013-05-19t15:00:48.7070000",0,0,0],18,"/sports/soccer/england_premier_league",0,0],[2401270,"west brom","man utd",1,"2013-05-19t15:00:00.0000000",[[4977145,39]],0,2,1,[1,90,"2013-05-19t15:03:06.0200000",0],17,"/sports/soccer/england_premier_league",,],[2401271,"wigan","aston villa",1,"2013-05-19t15:00:00.0000000",[[4977147,39]],1,1,1,[1,30,"2013-05-19t15:00:48.7530000",0],17,"/sports/soccer/england_premier_league",,],[2408847,"dep la coruna","espanyol",1,"2013-05-19t15:00:00.0000000",[[4979597,39]],0,0,1,[1,90,"2013-05-19t15:01:11.2030000",0,0,0],27,"/sports/soccer/spain_la_liga",0,0],[2408897,"hercules","mirandes",1,"2013-05-19t15:00:00.0000000",[[4987070,39]],0,0,1,[1,30,"2013-05-19t15:00:48.4570000",0],18,"/sports/soccer/spain_segunda",,],[2408960,"korona kielce","jagiellonia bialystok",1,"2013-05-19t15:00:00.0000000",[[4999194,39]],1,0,1,[1,30,"2013-05-19t15:00:54.3700000",0],17,"/sports/soccer/poland_ekstraklasa",,],[2412214,"varnamo ifk","gais goteborg",1,"2013-05-19t15:00:00.0000000",[[4988445,39]],0,0,1,[1,30,"2013-05-19t15:00:48.3800000",0],27,"/sports/soccer/sweden_superettan",,],[2412215,"panos ljungskile","jonkopings sodra",1,"2013-05-19t15:00:00.0000000",[[4988447,39]],0,0,1,[1,30,"2013-05-19t15:00:54.4000000",0],27,"/sports/soccer/sweden_superettan",,],[2413870,"paok saloniki","pas giannina",1,"2013-05-19t15:15:00.0000000",[[4999196,39]],0,0,1,[1,570,"2013-05-19t15:15:36.1670000",0],18,"/sports/soccer/greece_super_league",,],[2417005,"turkey u16","russia u16",1,"2013-05-19t14:00:00.0000000",[[5001521,39]],1,0,1,[2,2790,"2013-05-19t15:02:31.6370000",0],0,"/sports/soccer/friendly_intl_u16",,],[2401264,"liverpool","queens p rangers",1,"2013-05-19t15:00:00.0000000",[[4977133,39]],1,0,1,[1,30,"2013-05-19t15:00:48.3470000",0],17,"/sports/soccer/england_premier_league",,],[2401268,"swansea","fulham",1,"2013-05-19t15:00:00.0000000",[[4977141,39]],0,1,1,[1,30,"2013-05-19t15:00:48.8630000",0],17,"/sports/soccer/england_premier_league",,],[2408652,"zenit st. petersburg","volga nizhniy novgorod",1,"2013-05-19t14:30:00.0000000",[[4987679,39]],1,1,1,[3,2790,"2013-05-19t15:18:21.6570000",0,0,0],24,"/sports/soccer/russia_premier_liga",0,0],[2411551,"diosgyor balaton","kecskemet",1,"2013-05-19t14:30:00.0000000",[[4999186,39]],0,1,1,[3,2730,"2013-05-19t15:18:21.6230000",0,0,0],16,"/sports/soccer/hungary_nb_i",0,0],[2414581,"utrecht","heerenveen",1,"2013-05-19t14:30:00.0000000",[[4999188,39]],1,0,1,[3,2730,"2013-05-19t15:16:28.2570000",0],16,"/sports/soccer/netherlands_eredivisie",,],[2414656,"roda","de graafschap",1,"2013-05-19t14:30:00.0000000",[[4999190,39]],3,1,1,[3,2790,"2013-05-19t15:19:08.9100000",0],16,"/sports/soccer/netherlands_eerste_div",,],[2401265,"man city","norwich",1,"2013-05-19t15:00:00.0000000",[[4977135,39]],0,1,1,[1,30,"2013-05-19t15:00:48.3170000",0],18,"/sports/soccer/england_premier_league",,],[2408690,"sturm graz","ried",1,"2013-05-19t14:00:00.0000000",[[4986537,39]],1,1,1,[2,2790,"2013-05-19t15:04:14.3830000",0],16,"/sports/soccer/austria_bundesliga",,],[2401272,"west ham","reading",1,"2013-05-19t15:00:00.0000000",[[4977149,39]],1,0,1,[1,30,"2013-05-19t15:02:29.9830000",0],18,"/sports/soccer/england_premier_league",,],[2414909,"peristeri","ilisiakos bc",2,"2013-05-19t14:00:00.0000000",[[5001488,39]],48,49,1,[0,0,"2013-05-19t13:58:54.3470000",0],5,"/sports/basketball/greece_a1",,],[2417273,"istanbul teknik uni","duzce belediye",2,"2013-05-19t15:00:00.0000000",[[5001550,39]],16,26,1,[0,0,"2013-05-19t15:09:41.7100000",0],6,"/sports/basketball/friendly",,],[2417087,"benfica","academica",2,"2013-05-19t15:00:00.0000000",[[5001548,39]],23,11,1,[0,0,"2013-05-19t15:09:32.3000000",0],6,"/sports/basketball/portugal_liga_tmn",,],[2416259,"edouard roger-vasselin [fra]","alejandro falla [col]",6,"2013-05-19t14:55:00.0000000",[[5000358,39]],3001,4000,1,[0,0,"2013-05-19t04:13:48.0670000",0,3,0],2,"/sports/tennis/atp_nice",3,0],[2416856,"flavia pennetta [ita]","katarzyna piter [pol]",6,"2013-05-19t10:00:00.0000000",[[5000441,39]],6000,5001,1,[0,0,"2013-05-19t05:28:36.6800000",0,3,0],2,"/sports/tennis/wta_strasbourg_qualifiers",3,0],[2416854,"marta domachowska [pol]","arantxa parra santonja [esp]",6,"2013-05-19t09:30:00.0000000",[[5000437,39]],46001,33000,1,[0,0,"2013-05-19t05:28:36.4700000",0,3,0],2,"/sports/tennis/wta_strasbourg_qualifiers",3,0],[2416265,"finland ","usa ",8,"2013-05-19t14:00:00.0000000",[[5000330,39]],0,2,1,[0,0,"2013-05-19t03:57:47.0200000",0],0,"/sports/ice_hockey/world_championship_2013",,],[2416824,"sunrisers hyderabad","kolkata knight riders",22,"2013-05-19t14:30:00.0000000",[[5001544,39]],0,0,1,[0,0,"2013-05-19t15:03:26.2830000",0],0,"/sports/cricket/indian_premier_league",,],[2417259,"el jaish","al rayyan ",19,"2013-05-19t14:00:00.0000000",[[5001502,39]],1,2,1,[0,0,"2013-05-19t14:06:27.8300000",0],0,"/sports/volleyball/friendlies_international",,]],[[1,"soccer",1,1,["1x2","asians","o/u"]],[2,"basketball",2,2,["ml","spread","o/u"]],[6,"tennis",6,6,["winner","handicap","o/u"]],[8,"ice hockey",8,8,["match winner","spread","o/u"]],[22,"cricket",22,22,["moneyline","spread","o/u"]],[19,"volleyball",19,19,["ml","sets handicap","o/u"]]]] 

how can convert json data php use in json_decode()?

it's easy: looks json, isn't. use following code transform json_decode() accept:

$input = <<<eol [[[2401263,"chelsea","everton",1,"2013-05-19t15:00:00.0000000",[[4977131,39]],1$ eol;  $input2 = str_replace(",,", ",null,", $input); $json = str_replace(",]", "]", $input2);  var_dump(json_decode($json)); 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -