Jsonp_callback ({"MSG": "OK", "Rela_opera": -4, "bimg": "http://v9.pfs.56img.com/images/22/6/ Justin0842i56olo56i56.com_sc_141525800944hd_b.jpg "," vid ":" 129515958 "," opera_id ": -4," Subject ":" Dig Map "Elevator", "status ":" 1 "," duration ":" 146001 "," CPM ": 1," tags ":" Dig map,,,, "," df ": [{" url ":" Http://f8.r.56.com/f8.c178.56.com/flvdownload /21/4/sc_141525800944hd_qqvga.mp4?v=1&t=qo1wwemf4mtmbotihxanva&r=14513&e=1415869829&tt=146 &sz=1701822&vid=129515958 "," type ":" QQVGA "},{" url ":" Http://f8.r.56.com/f8.c196.56.com/flvdownload/19/0/ sc_141525800944hd.flv.mp4?v=1&t=uikhlaf7oyfyohqtt5q6yg&r=14513&e=1415869829&tt=146&sz= 5628144&vid=129515958 "," type ":" QVGA "},{" url ":" Http://f8.r.56.com/f8.c178.56.com/flvdownload/28/4/sc_ 141525800944hd_clear.flv.mp4?v=1&t=_vatplkpnqnkrdu-75v9iw&r=14513&e=1415869829&tt=145&sz= 10229011&vid=129515958 "," type ":" VGA "},{" url ":" Http://f8.r.56.com/f8.c177.56.com/flvdownload/17/11/sc_ 141525800944hd_super.flv.mp4?v=1&t=dagxouspchpml5yv3iekfa&r=14513&e=1415869829&tt=145&sz=20032192&vid=129515958 "," type ":" WVGA "}]," CID ":" 4 " , "user_id": "justin0842"});
----------------------------
The above is the received data format. How to deal with the array.??
Thank you
Reply to discussion (solution)
$arr = Json_decode ($json, true);
$arr = Json_decode ($json, true);
Oh, no. You are. Try copying the JSON above
$str = ' {' msg ': ' OK ', ' rela_opera ': -4, ' bimg ': ' Http://v9.pfs.56img.com/images/22/6/justin0842i56olo56i56.com_sc_ 141525800944hd_b.jpg "," vid ":" 129515958 "," opera_id ": -4," Subject ":" Dig Map "Elevator", "status": "1", "duration": "146001", " CPM ": 1," tags ":" Dig map,,,, "," df ": [{" url ":" Http://f8.r.56.com/f8.c178.56.com/flvdownload/21/4/sc_141525800944hd_ Qqvga.mp4?v=1&t=qo1wwemf4mtmbotihxanva&r=14513&e=1415869829&tt=146&sz=1701822&vid= 129515958 "," type ":" QQVGA "},{" url ":" Http://f8.r.56.com/f8.c196.56.com/flvdownload/19/0/sc_ 141525800944hd.flv.mp4?v=1&t=uikhlaf7oyfyohqtt5q6yg&r=14513&e=1415869829&tt=146&sz=5628144 &vid=129515958 "," type ":" QVGA "},{" url ":" Http://f8.r.56.com/f8.c178.56.com/flvdownload/28/4/sc_ 141525800944hd_clear.flv.mp4?v=1&t=_vatplkpnqnkrdu-75v9iw&r=14513&e=1415869829&tt=145&sz= 10229011&vid=129515958 "," type ":" VGA "},{" url ":" Http://f8.r.56.com/f8.c177.56.com/flvdownload/17/11/sc_ 141525800944hd_super.flv.mp4?v=1&t=dagxouspchpml5yv3iekfa&r=14513&e=1415869829&tt=145&sz=20032192&vid=129515958 "," type ":" WVGA "}]," CID ":" 4 "," User_ ID ":" justin0842 "} '; $json = Json_decode ($str, True); Var_dump ($json);
$s = ' jsonp_callback ({"MSG": "OK", "Rela_opera": -4, "bimg": "http://v9.pfs.56img.com/images/22/6/ Justin0842i56olo56i56.com_sc_141525800944hd_b.jpg "," vid ":" 129515958 "," opera_id ": -4," Subject ":" Dig Map "Elevator", "status ":" 1 "," duration ":" 146001 "," CPM ": 1," tags ":" Dig map,,,, "," df ": [{" url ":" Http://f8.r.56.com/f8.c178.56.com/flvdownload /21/4/sc_141525800944hd_qqvga.mp4?v=1&t=qo1wwemf4mtmbotihxanva&r=14513&e=1415869829&tt=146 &sz=1701822&vid=129515958 "," type ":" QQVGA "},{" url ":" Http://f8.r.56.com/f8.c196.56.com/flvdownload/19/0/ sc_141525800944hd.flv.mp4?v=1&t=uikhlaf7oyfyohqtt5q6yg&r=14513&e=1415869829&tt=146&sz= 5628144&vid=129515958 "," type ":" QVGA "},{" url ":" Http://f8.r.56.com/f8.c178.56.com/flvdownload/28/4/sc_ 141525800944hd_clear.flv.mp4?v=1&t=_vatplkpnqnkrdu-75v9iw&r=14513&e=1415869829&tt=145&sz= 10229011&vid=129515958 "," type ":" VGA "},{" url ":" Http://f8.r.56.com/f8.c177.56.com/flvdownload/17/11/sc_ 141525800944hd_super.flv.mp4?v=1&t=dagxouspchpml5yv3iekfa&r=14513&e=1415869829&tt=145&sz=20032192&vid=129515958 "," type ":" WVGA "}]," CID ":" 4 "," user_id ":" justin0842 "}); $a = Json_decode (Preg_replace ('/.*\ ((. +) \). */', ' $ ', $s), 1);p rint_r ($a);
Array ([MSG] = OK [Rela_opera] = 4 [bimg] = Http://v9.pfs.56img.com/images/22/6/justin0842i56olo56i5 6.com_sc_141525800944hd_b.jpg [vid] = 129515958 [opera_id] +-4 [Subject] = "Dig map" elevator [status] + 1 [Duration] = 146001 [CPM] = 1 [tags] = dig map,,,, [df] = = Array ([0] = A Rray ([url] = http://f8.r.56.com/f8.c178.56.com/flvdownload/21/4/sc_141525800944hd_ Qqvga.mp4?v=1&t=qo1wwemf4mtmbotihxanva&r=14513&e=1415869829&tt=146&sz=1701822&vid= 129515958 [Type] = QQVGA) [1] = = Array ( [url] = http://f8.r.56.com/f8.c196.56.com/flvdownload/19/0/sc_141525800944hd.flv.mp4?v=1&t= uikhlaf7oyfyohqtt5q6yg&r=14513&e=1415869829&tt=146&sz=5628144&vid=129515958 [Type] = = QVGA) [2] = = Array ([url] = http://f8.r.56.com/f8.c178.56.com/flvdownload/28/4/sc_141525800944hd_clear.f Lv.mp4?v=1&t=_vatplkpnqnkrdu-75v9iw&r=14513&e=1415869829&tt=145&sz=10229011&vid= 129515958 [Type] = VGA) [3] = = Array ( [url] = http://f8.r.56.com/f8.c177.56.com/flvdownload/17/11/sc_141525800944hd_super.flv.mp4?v=1&t= dagxouspchpml5yv3iekfa&r=14513&e=1415869829&tt=145&sz=20032192&vid=129515958 [Type] = WVGA)) [CID] + 4 [user_id] = justin0842)