2

This is the string i have retrieved from youtube mobile site. I want to extract the json using php.

$str = ")]}'{\"conn\": \"wifi\", \"content\": {\"pyv_ping_url\": null, \"subscription_state\": {\"subscribe_url\": {\"url\": \"\\\/channel_post?feature=watch\\u0026action_subscribe=1\", \"channel_id\": \"UCeQEKFH31vvD-InkTGSvCrA\"}, \"show_button\": true, \"is_subscribed\": false}, \"distiller_config\": {\"owner_id\": \"eQEKFH31vvD-InkTGSvCrA\", \"visible\": null, \"pinned_activity\": null, \"channel_id\": \"UCeQEKFH31vvD-InkTGSvCrA\", \"privacy_setting\": \"PUBLIC\", \"query\": \"http:\\\/\\\/www.youtube.com\\\/watch?v=C5tOEBmBAHg\", \"signin_url\": \"https:\\\/\\\/accounts.google.com\\\/ServiceLogin?service=youtube\\u0026passive=true\\u0026uilel=3\\u0026hl=en_US\\u0026ltmpl=mobile\\u0026continue=http%3A%2F%2Fm.youtube.com%2Fsignin%3Faction_handle_signin%3Dtrue%26feature%3Ddistiller%26hl%3Den_US%26next%3D%252Fwatch%253Fv%253DC5tOEBmBAHg%2526client%253Dmv-google%26nomobiletemp%3D1\", \"video_id\": \"C5tOEBmBAHg\", \"debug\": false, \"filter_premod\": false}, \"allow_comments\": true, \"ad_instream\": \"\", \"show_pyv_in_related\": false, \"player_data\":
   {\"fmt_stream_map\": [{\"itag\": \"18\", \"type\": \"video\\\/mp4; codecs=\\\"avc1.42001E, mp4a.40.2\\\"\", \"fallback_host\": \"tc.v6.cache1.c.youtube.com\", \"quality\": \"medium\", \"url\": \"http:\\\/\\\/r4---sn-nau-jhcl.c.youtube.com\\\/videoplayback?ms=au\\u0026itag=18\\u0026mt=1378896627\\u0026app=youtube_mobile\\u0026mv=m\\u0026source=youtube\\u0026sver=3\\u0026expire=1378918433\\u0026sparams=cp%2Cid%2Cip%2Cipbits%2Citag%2Cratebypass%2Csource%2Cupn%2Cexpire\\u0026cp=U0hWTVlMVl9ITUNONl9RRlpFOkV6dktxMFVBYU1Y\\u0026upn=kjDilUW5IQE\\u0026ip=124.43.93.65\\u0026dnc=1\\u0026el=watch\\u0026yms=FcwHm3XWaNY\\u0026ratebypass=yes\\u0026key=yt1\\u0026signature=06D949BF71135F49A3BE9E7A47182B2A61DCF915.5B86FC625C760F1402BC700C660E61CC69684992\\u0026id=0b9b4e1019810078\\u0026fexp=907724%2C906942%2C924606%2C929117%2C929121%2C929906%2C929907%2C929922%2C929127%2C929129%2C929131%2C929930%2C936403%2C925726%2C936310%2C925720%2C925722%2C925718%2C925714%2C929917%2C906945%2C929933%2C920302%2C906842%2C913428%2C919811%2C913563%2C919373%2C930803%2C908536%2C938701%2C931924%2C936308%2C909549%2C900816%2C912711%2C904494%2C904497%2C939903%2C900375%2C900382%2C934507%2C907231%2C936312%2C906001\\u0026ipbits=8\"}, {\"itag\": \"36\", \"type\": \"video\\\/3gpp; codecs=\\\"mp4v.20.3, mp4a.40.2\\\"\", \"fallback_host\": \"tc.v23.cache2.c.youtube.com\", \"quality\": \"small\",
   \"url\": \"http:\\\/\\\/r4---sn-nau-jhcl.c.youtube.com\\\/videoplayback?ms=au\\u0026itag=36\\u0026mt=1378896627\\u0026app=youtube_mobile\\u0026mv=m\\u0026source=youtube\\u0026sver=3\\u0026expire=1378918433\\u0026sparams=cp%2Cid%2Cip%2Cipbits%2Citag%2Cratebypass%2Csource%2Cupn%2Cexpire\\u0026cp=U0hWTVlMVl9ITUNONl9RRlpFOkV6dktxMFVBYU1Y\\u0026upn=kjDilUW5IQE\\u0026ip=124.43.93.65\\u0026dnc=1\\u0026el=watch\\u0026yms=FcwHm3XWaNY\\u0026ratebypass=yes\\u0026key=yt1\\u0026signature=663C16B74F22132913A4E86CFE733CEFC10C18C3.175EA19B37241399C17305FAACEFB07A1C5FB2DD\\u0026id=0b9b4e1019810078\\u0026fexp=907724%2C906942%2C924606%2C929117%2C929121%2C929906%2C929907%2C929922%2C929127%2C929129%2C929131%2C929930%2C936403%2C925726%2C936310%2C925720%2C925722%2C925718%2C925714%2C929917%2C906945%2C929933%2C920302%2C906842%2C913428%2C919811%2C913563%2C919373%2C930803%2C908536%2C938701%2C931924%2C936308%2C909549%2C900816%2C912711%2C904494%2C904497%2C939903%2C900375%2C900382%2C934507%2C907231%2C936312%2C906001\\u0026ipbits=8\"}], \"playability\": \"PLAY_OK\", \"player_type\": \"html5fs\"}, \"subscribe_xsrf_token\": \"V-JkAZNXVIi4gjwRIRaUyy1rqh98MTM3ODk4MzA2MUAxMzc4ODk2NjYx\", \"channel_subscriber_count\": 1445686, \"should_prompt_merge_identity\": false, \"branding\": null, \"sentiment_xsrf_token\": \"rUe1DX9B6S0kBEJwaYYRBQkgw1J8MTM3ODk4MzA2MUAxMzc4ODk2NjYx\", \"ptracking\": \"\\\/\\\/www.youtube.com\\\/ptracking?ptk=brusspup%252Buser\\u0026pltype=content\\u0026oid=3OmbD_Dz3bv1YwNAoU8c6A\\u0026ptchn=brusspup\\u0026video_id=C5tOEBmBAHg\", \"next_url\": \"\\\/related?v=C5tOEBmBAHg\\u0026page=2\", \"allow_ratings\": true, \"video\": {\"user_image_url\": \"\\\/\\\/i1.ytimg.com\\\/i\\\/eQEKFH31vvD-InkTGSvCrA\\\/1.jpg?v=4efb5240\", \"time_created_text\": \"Sep  4, 2013\", \"duration\": \"2:09\", \"view_count\": \"2,767,499\", \"title\": \"Incredible Chemical Reaction!\", \"thumbnail_info\": null, \"comment_count\": 4367, \"dislikes_num\": 1203, \"longform\": false, \"profile_url\": \"\\\/user\\\/brusspup\", \"thumbnail_for_watch\": \"http:\\\/\\\/i.ytimg.com\\\/vi\\\/C5tOEBmBAHg\\\/hqdefault.jpg?w=320\\u0026h=192\\u0026sigh=yvFlZe6HDNoAvIPVEiRBbyEUDAw\", \"likes_num\": 21801, \"watch_link\": \"\\\/watch?v=C5tOEBmBAHg\", \"encrypted_id\": \"C5tOEBmBAHg\", \"description\": \"Add me on Facebook. (click LIKE on Facebook to add me) \\nhttp:\\\/\\\/www.facebook.com\\\/brusspup\\n\\n\\nDownload the song in this video:\\nSong name: Monolith\\n\\niTunes\\nhttps:\\\/\\\/itunes.apple.com\\\/us\\\/album\\\/monolith-single\\\/id596457486\\n\\nAmazon\\nhttp:\\\/\\\/www.amazon.com\\\/Monolith\\\/dp\\\/B00B60NGFY\\\/ref=sr_1_1?ie=UTF8\\u0026qid=1378343773\\u0026sr=8-1\\u0026keywords=monolith+brusspup\\n\\nThere are no editing tricks in the video. All of the reactions that you see are uncut and play at the original speed.\\n\\nThis is a classic chemical reaction. It's called the iodine clock reaction. There are several variations of how this chemical reaction can be performed using different chemicals than the ones I used in the video. You can order clock reaction kits from several science related websites. You can also use simple store bought chemicals like vitamin C, iodine, hydrogen peroxide and starch. A quick internet search will turn up multiple ways of performing the experiment.\\n\\nEven though I've played around with the clock reaction experiment before I've always wanted to capture the reaction as the liquid was being poured. To me, this is the most stunning way of demonstrating the reaction.\\n\\nHere's the other version of the clock reaction I made several years ago\\nhttp:\\\/\\\/www.youtube.com\\\/watch?v=qeDhaWEEvfg\", \"length_seconds\": 129, \"public_name\": \"brusspup\"}, \"related_videos\": [{\"duration\": \"2:40\", \"view_count\": \"411,584\", \"title\": \"Amazing Hologram Effect!\", \"thumbnail_info\": {\"posx\": 0, \"posy\": 0, \"stitched\": 1, \"width\": 128, \"height\": 880, \"thumb_height\": 72, \"url\": \"http:\\\/\\\/i.ytimg.com\\\/vt?cids=WllhvcRH3KM,8tHOVVgGkpk,wvJAgrUBF4w,1yaqUI4b974,hq8j86OenqM,xVyYcAI90jw,vZaRgMOo-Ig,dMuGAmdr8m4,uENITui5_jU,hSorsJ-lRYk,kf1xFCcvadg\\u0026w=120\\u0026h=72\\u0026sigh=c99tZpvMiwZDzKB_NwFL5pdZ3QM\", \"thumb_width\": 120}, \"related_feature\": \"relmfu\", \"thumbnail_for_watch\": \"http:\\\/\\\/i.ytimg.com\\\/vi\\\/WllhvcRH3KM\\\/hqdefault.jpg?w=320\\u0026h=192\\u0026sigh=t18Qmilb_rFtwJKJTBCKbaRLQyo\", \"playability\": \"NO_PREFETCH\", \"watch_link\": \"\\\/watch?v=WllhvcRH3KM\\u0026feature=relmfu\", \"encrypted_id\": \"WllhvcRH3KM\", \"public_name\": \"brusspup\"}, {\"duration\": \"2:21\", \"view_count\": \"2,589,152\", \"title\": \"Giant Dry Ice Bubble Experiment!\", \"thumbnail_info\": {\"posx\": 0, \"posy\": 80, \"stitched\": 1, \"width\": 128, \"height\": 880, \"thumb_height\": 72, \"url\": \"http:\\\/\\\/i.ytimg.com\\\/vt?cids=WllhvcRH3KM,8tHOVVgGkpk,wvJAgrUBF4w,1yaqUI4b974,hq8j86OenqM,xVyYcAI90jw,vZaRgMOo-Ig,dMuGAmdr8m4,uENITui5_jU,hSorsJ-lRYk,kf1xFCcvadg\\u0026w=120\\u0026h=72\\u0026sigh=c99tZpvMiwZDzKB_NwFL5pdZ3QM\", \"thumb_width\": 120}, \"related_feature\": \"relmfu\", \"thumbnail_for_watch\": \"http:\\\/\\\/i.ytimg.com\\\/vi\\\/8tHOVVgGkpk\\\/hqdefault.jpg?w=320\\u0026h=192\\u0026sigh=hITPLWQ4XEdyqU3OAuySRYY0jRA\", \"playability\": \"NO_PREFETCH\", \"watch_link\": \"\\\/watch?v=8tHOVVgGkpk\\u0026feature=relmfu\", \"encrypted_id\": \"8tHOVVgGkpk\", \"public_name\": \"brusspup\"}, {\"duration\": \"3:39\", \"view_count\": \"3,529,768\", \"title\": \"Amazing Resonance Experiment!\", \"thumbnail_info\": {\"posx\": 0, \"posy\": 160, \"stitched\": 1, \"width\": 128, \"height\": 880, \"thumb_height\": 72, \"url\": \"http:\\\/\\\/i.ytimg.com\\\/vt?cids=WllhvcRH3KM,8tHOVVgGkpk,wvJAgrUBF4w,1yaqUI4b974,hq8j86OenqM,xVyYcAI90jw,vZaRgMOo-Ig,dMuGAmdr8m4,uENITui5_jU,hSorsJ-lRYk,kf1xFCcvadg\\u0026w=120\\u0026h=72\\u0026sigh=c99tZpvMiwZDzKB_NwFL5pdZ3QM\", \"thumb_width\": 120}, \"related_feature\": \"relmfu\", \"thumbnail_for_watch\": \"http:\\\/\\\/i.ytimg.com\\\/vi\\\/wvJAgrUBF4w\\\/hqdefault.jpg?w=320\\u0026h=192\\u0026sigh=jNtSWzQ8HbjFb5KQ27wggqmLmlc\", \"playability\": \"NO_PREFETCH\", \"watch_link\": \"\\\/watch?v=wvJAgrUBF4w\\u0026feature=relmfu\", \"encrypted_id\": \"wvJAgrUBF4w\", \"public_name\": \"brusspup\"}, {\"duration\": \"8:20\", \"view_count\": \"334,912\", \"title\": \"Resonance Experiment! (Full Version - With Tones)\", \"thumbnail_info\": {\"posx\": 0, \"posy\": 240, \"stitched\": 1, \"width\": 128, \"height\": 880, \"thumb_height\": 72, \"url\": \"http:\\\/\\\/i.ytimg.com\\\/vt?cids=WllhvcRH3KM,8tHOVVgGkpk,wvJAgrUBF4w,1yaqUI4b974,hq8j86OenqM,xVyYcAI90jw,vZaRgMOo-Ig,dMuGAmdr8m4,uENITui5_jU,hSorsJ-lRYk,kf1xFCcvadg\\u0026w=120\\u0026h=72\\u0026sigh=c99tZpvMiwZDzKB_NwFL5pdZ3QM\", \"thumb_width\": 120}, \"related_feature\": \"relmfu\", \"thumbnail_for_watch\": \"http:\\\/\\\/i.ytimg.com\\\/vi\\\/1yaqUI4b974\\\/hqdefault.jpg?w=320\\u0026h=192\\u0026sigh=tOEOMdumSWc1G--uyQNZJ1_r1HY\", \"playability\": \"NO_PREFETCH\", \"watch_link\": \"\\\/watch?v=1yaqUI4b974\\u0026feature=relmfu\", \"encrypted_id\": \"1yaqUI4b974\", \"public_name\": \"brusspup\"}, {\"duration\": \"1:24\", \"view_count\": \"840,664\", \"title\": \"335-foot 700 Ton Ship Flips\", \"thumbnail_info\": {\"posx\": 0, \"posy\": 320, \"stitched\": 1, \"width\": 128, \"height\": 880, \"thumb_height\": 72, \"url\": \"http:\\\/\\\/i.ytimg.com\\\/vt?cids=WllhvcRH3KM,8tHOVVgGkpk,wvJAgrUBF4w,1yaqUI4b974,hq8j86OenqM,xVyYcAI90jw,vZaRgMOo-Ig,dMuGAmdr8m4,uENITui5_jU,hSorsJ-lRYk,kf1xFCcvadg\\u0026w=120\\u0026h=72\\u0026sigh=c99tZpvMiwZDzKB_NwFL5pdZ3QM\", \"thumb_width\": 120}, \"related_feature\": \"related\", \"thumbnail_for_watch\": \"http:\\\/\\\/i.ytimg.com\\\/vi\\\/hq8j86OenqM\\\/hqdefault.jpg?w=320\\u0026h=192\\u0026sigh=Go1pp4c_d6887ErOHp0rEfAsGoU\", \"playability\": \"NO_PREFETCH\", \"watch_link\": \"\\\/watch?v=hq8j86OenqM\\u0026feature=related\", \"encrypted_id\": \"hq8j86OenqM\", \"public_name\": \"Rick Scheu\"}, {\"duration\": \"1:18\", \"view_count\": \"400,264\", \"title\": \"Ashending against gravity by Kokichi Sugihara\", \"thumbnail_info\": {\"posx\": 0, \"posy\": 400, \"stitched\": 1, \"width\": 128, \"height\": 880, \"thumb_height\": 72, \"url\": \"http:\\\/\\\/i.ytimg.com\\\/vt?cids=WllhvcRH3KM,8tHOVVgGkpk,wvJAgrUBF4w,1yaqUI4b974,hq8j86OenqM,xVyYcAI90jw,vZaRgMOo-Ig,dMuGAmdr8m4,uENITui5_jU,hSorsJ-lRYk,kf1xFCcvadg\\u0026w=120\\u0026h=72\\u0026sigh=c99tZpvMiwZDzKB_NwFL5pdZ3QM\", \"thumb_width\": 120}, \"related_feature\": \"related\", \"thumbnail_for_watch\": \"http:\\\/\\\/i.ytimg.com\\\/vi\\\/xVyYcAI90jw\\\/hqdefault.jpg?w=320\\u0026h=192\\u0026sigh=gmPmiN0TY7CtOOafAxsBQYC-CuE\", \"playability\": \"NO_PREFETCH\", \"watch_link\": \"\\\/watch?v=xVyYcAI90jw\\u0026feature=related\", \"encrypted_id\": \"xVyYcAI90jw\", \"public_name\": \"Gianluigi Filippelli\"}, {\"duration\": \"0:55\", \"view_count\": \"573,904\", \"title\": \"Sold! Nadex Coin Sorter Counter\", \"thumbnail_info\": {\"posx\": 0, \"posy\": 480, \"stitched\": 1, \"width\": 128, \"height\": 880, \"thumb_height\": 72, \"url\": \"http:\\\/\\\/i.ytimg.com\\\/vt?cids=WllhvcRH3KM,8tHOVVgGkpk,wvJAgrUBF4w,1yaqUI4b974,hq8j86OenqM,xVyYcAI90jw,vZaRgMOo-Ig,dMuGAmdr8m4,uENITui5_jU,hSorsJ-lRYk,kf1xFCcvadg\\u0026w=120\\u0026h=72\\u0026sigh=c99tZpvMiwZDzKB_NwFL5pdZ3QM\", \"thumb_width\": 120}, \"related_feature\": \"related\", \"thumbnail_for_watch\": \"http:\\\/\\\/i.ytimg.com\\\/vi\\\/vZaRgMOo-Ig\\\/hqdefault.jpg?w=320\\u0026h=192\\u0026sigh=m3COC6q6y7FXbBlzpYCkCEEQJjI\", \"playability\": \"NO_PREFETCH\", \"watch_link\": \"\\\/watch?v=vZaRgMOo-Ig\\u0026feature=related\", \"encrypted_id\": \"vZaRgMOo-Ig\", \"public_name\": \"Curtis Zeisler\"}, {\"duration\": \"4:57\", \"view_count\": \"337,612\", \"title\": \"How To Solve A Rubik's Cube (No Memorization) - Part 1\\\/4\", \"thumbnail_info\": {\"posx\": 0, \"posy\": 560, \"stitched\": 1, \"width\": 128, \"height\": 880, \"thumb_height\": 72, \"url\": \"http:\\\/\\\/i.ytimg.com\\\/vt?cids=WllhvcRH3KM,8tHOVVgGkpk,wvJAgrUBF4w,1yaqUI4b974,hq8j86OenqM,xVyYcAI90jw,vZaRgMOo-Ig,dMuGAmdr8m4,uENITui5_jU,hSorsJ-lRYk,kf1xFCcvadg\\u0026w=120\\u0026h=72\\u0026sigh=c99tZpvMiwZDzKB_NwFL5pdZ3QM\", \"thumb_width\": 120}, \"related_feature\": \"related\", \"thumbnail_for_watch\": \"http:\\\/\\\/i.ytimg.com\\\/vi\\\/dMuGAmdr8m4\\\/hqdefault.jpg?w=320\\u0026h=192\\u0026sigh=fwyZkY1zLp5hrS1PTh9qd7d4hmA\", \"playability\": \"NO_PREFETCH\", \"watch_link\": \"\\\/watch?v=dMuGAmdr8m4\\u0026feature=related\", \"encrypted_id\": \"dMuGAmdr8m4\", \"public_name\": \"Philip Brocoum\"}, {\"duration\": \"2:17\", \"view_count\": \"6,678,361\", \"title\": \"Amazing Water \\u0026 Sound Experiment #2\", \"thumbnail_info\": {\"posx\": 0, \"posy\": 640, \"stitched\": 1, \"width\": 128, \"height\": 880, \"thumb_height\": 72, \"url\": \"http:\\\/\\\/i.ytimg.com\\\/vt?cids=WllhvcRH3KM,8tHOVVgGkpk,wvJAgrUBF4w,1yaqUI4b974,hq8j86OenqM,xVyYcAI90jw,vZaRgMOo-Ig,dMuGAmdr8m4,uENITui5_jU,hSorsJ-lRYk,kf1xFCcvadg\\u0026w=120\\u0026h=72\\u0026sigh=c99tZpvMiwZDzKB_NwFL5pdZ3QM\", \"thumb_width\": 120}, \"related_feature\": \"relmfu\", \"thumbnail_for_watch\": \"http:\\\/\\\/i.ytimg.com\\\/vi\\\/uENITui5_jU\\\/hqdefault.jpg?w=320\\u0026h=192\\u0026sigh=3V07FkPBElUksqkiE6jhgR5mv_o\", \"playability\": \"NO_PREFETCH\", \"watch_link\": \"\\\/watch?v=uENITui5_jU\\u0026feature=relmfu\", \"encrypted_id\": \"uENITui5_jU\", \"public_name\": \"brusspup\"}, {\"duration\": \"1:37\", \"view_count\": \"1,352,850\", \"title\": \"Liquid Stacking! (How To)\", \"thumbnail_info\": {\"posx\": 0, \"posy\": 720, \"stitched\": 1, \"width\": 128, \"height\": 880, \"thumb_height\": 72, \"url\": \"http:\\\/\\\/i.ytimg.com\\\/vt?cids=WllhvcRH3KM,8tHOVVgGkpk,wvJAgrUBF4w,1yaqUI4b974,hq8j86OenqM,xVyYcAI90jw,vZaRgMOo-Ig,dMuGAmdr8m4,uENITui5_jU,hSorsJ-lRYk,kf1xFCcvadg\\u0026w=120\\u0026h=72\\u0026sigh=c99tZpvMiwZDzKB_NwFL5pdZ3QM\", \"thumb_width\": 120}, \"related_feature\": \"relmfu\", \"thumbnail_for_watch\": \"http:\\\/\\\/i.ytimg.com\\\/vi\\\/hSorsJ-lRYk\\\/hqdefault.jpg?w=320\\u0026h=192\\u0026sigh=LePBch42wY_Icephs7Yhw5R91BU\", \"playability\": \"NO_PREFETCH\", \"watch_link\": \"\\\/watch?v=hSorsJ-lRYk\\u0026feature=relmfu\", \"encrypted_id\": \"hSorsJ-lRYk\", \"public_name\": \"brusspup\"}, {\"duration\": \"0:56\", \"view_count\": \"3,869,695\", \"title\": \"Amazing Swimming Pool Illusion!\", \"thumbnail_info\": {\"posx\": 0, \"posy\": 800, \"stitched\": 1, \"width\": 128, \"height\": 880, \"thumb_height\": 72, \"url\": \"http:\\\/\\\/i.ytimg.com\\\/vt?cids=WllhvcRH3KM,8tHOVVgGkpk,wvJAgrUBF4w,1yaqUI4b974,hq8j86OenqM,xVyYcAI90jw,vZaRgMOo-Ig,dMuGAmdr8m4,uENITui5_jU,hSorsJ-lRYk,kf1xFCcvadg\\u0026w=120\\u0026h=72\\u0026sigh=c99tZpvMiwZDzKB_NwFL5pdZ3QM\", \"thumb_width\": 120}, \"related_feature\": \"relmfu\", \"thumbnail_for_watch\": \"http:\\\/\\\/i.ytimg.com\\\/vi\\\/kf1xFCcvadg\\\/hqdefault.jpg?w=320\\u0026h=192\\u0026sigh=C1aCdkCphemgOJChXG0f43WVoeU\", \"playability\": \"NO_PREFETCH\", \"watch_link\": \"\\\/watch?v=kf1xFCcvadg\\u0026feature=relmfu\", \"encrypted_id\": \"kf1xFCcvadg\", \"public_name\": \"brusspup\"}]}, \"result\": \"ok\", \"signed_in_username\": \"\", \"build_signature\": \"en:900375,900382,900816,904494,904497,906001,906842,906942,906945,907231,907724,908536,909549,912711,913428,913563,919373,919811,920302,924606,925714,925718,925720,925722,925726,929117,929121,929127,929129,929131,929906,929907,929917,929922,929930,929933,930803,931924,934507,936308,936310,936312,936403,938701,939903\", \"build_id\": 0}";
4
  • use json_decode($str); this will give you an array Commented Sep 11, 2013 at 11:33
  • 1
    This is certainly not valid JSON Commented Sep 11, 2013 at 11:35
  • How can i convert this to a valid json. My actuval task is to retrieve a url from this. Commented Sep 11, 2013 at 11:37
  • remove the first 3 characters, then you'll get an stdClass object by json_decode Commented Sep 11, 2013 at 11:39

1 Answer 1

2

The string is not valid JSON - The first few characters )]}' - Considering you have manually created the string, you can just remove them and then use json_decode

var_dump(json_decode($str));

Or dynamically using substr()

json_decode(substr($str, 4));
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.