graham23s Posted May 18, 2014 Share Posted May 18, 2014 Hey Guys, I'm receiving an api request back that looks like: [{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174222182518,"lsrc":80972326202,"ltgt":31581262572,"luuu":"groups.google.com/group/comp.infosystems.www.users/msg/9a210e5f72278328","pda":100,"ueid":355370,"uid":358079,"ulc":1394603890,"umrp":7.348021108330069,"umrr":4.2306065019844527e-07,"upa":95.04277845195264,"us":200,"ut":"HTTP cookie - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/HTTP_cookie"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174457993090,"lsrc":80972326202,"ltgt":31622557610,"luuu":"support.google.com/chrome/answer/95582?hl=en","pda":100,"ueid":355370,"uid":358079,"ulc":1394603890,"umrp":7.348021108330069,"umrr":4.2306065019844527e-07,"upa":95.04277845195264,"us":200,"ut":"HTTP cookie - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/HTTP_cookie"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174457997214,"lsrc":80972326202,"ltgt":31622557668,"luuu":"support.google.com/chrome/answer/95626?hl=en","pda":100,"ueid":355370,"uid":358079,"ulc":1394603890,"umrp":7.348021108330069,"umrr":4.2306065019844527e-07,"upa":95.04277845195264,"us":200,"ut":"HTTP cookie - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/HTTP_cookie"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174704422109,"lsrc":80972326202,"ltgt":31675615115,"luuu":"www.google.com/support/chrome/bin/answer.py?hl=en&answer=95582","pda":100,"ueid":355370,"uid":358079,"ulc":1394603890,"umrp":7.348021108330069,"umrr":4.2306065019844527e-07,"upa":95.04277845195264,"us":200,"ut":"HTTP cookie - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/HTTP_cookie"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174704422260,"lsrc":80972326202,"ltgt":31675615123,"luuu":"www.google.com/support/chrome/bin/answer.py?hl=en&answer=95626","pda":100,"ueid":355370,"uid":358079,"ulc":1394603890,"umrp":7.348021108330069,"umrr":4.2306065019844527e-07,"upa":95.04277845195264,"us":200,"ut":"HTTP cookie - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/HTTP_cookie"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174051896270,"lsrc":80975346908,"ltgt":31567049373,"luuu":"books.google.com/?id=0IZboamhb5EC&lpg=PA731","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174051900386,"lsrc":80975346908,"ltgt":31567051168,"luuu":"books.google.com/?id=58KxPNa0hF4C&lpg=PA463","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174051902110,"lsrc":80975346908,"ltgt":31567051879,"luuu":"books.google.com/?id=6xiYiybkE8kC&vq=core","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174051902955,"lsrc":80975346908,"ltgt":31567052243,"luuu":"books.google.com/?id=7veohk0fkLYC&lpg=PA88","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174051904343,"lsrc":80975346908,"ltgt":31567052883,"luuu":"books.google.com/?id=9iQYSQ9y60MC&lpg=PA49","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174051905960,"lsrc":80975346908,"ltgt":31567053635,"luuu":"books.google.com/?id=BgZyXNIrvB4C&pg=PT12","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174051911261,"lsrc":80975346908,"ltgt":31567055934,"luuu":"books.google.com/?id=Ho_RmgOnwgwC&lpg=PA8","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174051913146,"lsrc":80975346908,"ltgt":31567056717,"luuu":"books.google.com/?id=JttyjBoyb3AC&lpg=PA12","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174051920509,"lsrc":80975346908,"ltgt":31567059840,"luuu":"books.google.com/?id=SF7U27JsLC4C&dq=iraq+invasion+removes+hussein","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174051921673,"lsrc":80975346908,"ltgt":31567060362,"luuu":"books.google.com/?id=T_0TrXXiDbUC&dq=slavery+%22American+Civil+War%22","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174051922547,"lsrc":80975346908,"ltgt":31567060715,"luuu":"books.google.com/?id=UYpVAAAAYAAJ","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174051925466,"lsrc":80975346908,"ltgt":31567061980,"luuu":"books.google.com/?id=Y1dOLQN9hvwC&dq=SEALs+kill+Osama+bin+Laden","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174051936195,"lsrc":80975346908,"ltgt":31567066473,"luuu":"books.google.com/?id=jLy-NKnQitIC&pg=PA45&dq=uk+us+special+relationship","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174051937261,"lsrc":80975346908,"ltgt":31567066890,"luuu":"books.google.com/?id=ka6LxulZaEwC&vq=annexation&dq=territorial+expansion+United+States+%22manifest+destiny%22","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174051943179,"lsrc":80975346908,"ltgt":31567069364,"luuu":"books.google.com/?id=r71u_AgE7iYC&lpg=PA142","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174051949934,"lsrc":80975346908,"ltgt":31567072219,"luuu":"books.google.com/?id=yd4GqkP5XYgC&lpg=PA229","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174051950951,"lsrc":80975346908,"ltgt":31567072673,"luuu":"books.google.com/?id=zq4rsWNrYo4C&q=Reaganomics&dq=Reaganomics","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174052414947,"lsrc":80975346908,"ltgt":31567405066,"luuu":"books.google.com/books/about/A_History_of_the_American_People.html?id=RXSVQjz1_tMC","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174052676940,"lsrc":80975346908,"ltgt":31567608329,"luuu":"books.google.com/books/about/An_Empire_of_Wealth.html?id=rmsUs_KDgHAC","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174054227159,"lsrc":80975346908,"ltgt":31568894639,"luuu":"books.google.com/books/about/History_of_the_American_Economy_With_Acc.html?id=lyhI1q_E4G0C","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"}] I'm trying to retrieve all the backlinks located in these parts: "uu":"en.wikipedia.org/wiki/HTTP_cookie" "uu":"en.wikipedia.org/wiki/United_States" etc I tried this regex: $regex = returnSeoMozLinks("google.com"); $pattern = '""uu"":""(.*?)""'; $success = preg_match($pattern, $regex, $match); if ($success) { echo "Match: ".$match[0]."<br />"; } But it doesn't seem to work, i can do it in vb net but i am rusty with php lol any help would be appreciated guys! cheers Graham Quote Link to comment https://forums.phpfreaks.com/topic/288588-regex-help/ Share on other sites More sharing options...
mac_gyver Posted May 19, 2014 Share Posted May 19, 2014 why not just decode it and use php array functions to find/process the data - <?php $string = '[{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174222182518,"lsrc":80972326202,"ltgt":31581262572,"luuu":"groups.google.com/group/comp.infosystems.www.users/msg/9a210e5f72278328","pda":100,"ueid":355370,"uid":358079,"ulc":1394603890,"umrp":7.348021108330069,"umrr":4.2306065019844527e-07,"upa":95.04277845195264,"us":200,"ut":"HTTP cookie - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/HTTP_cookie"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174457993090,"lsrc":80972326202,"ltgt":31622557610,"luuu":"support.google.com/chrome/answer/95582?hl=en","pda":100,"ueid":355370,"uid":358079,"ulc":1394603890,"umrp":7.348021108330069,"umrr":4.2306065019844527e-07,"upa":95.04277845195264,"us":200,"ut":"HTTP cookie - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/HTTP_cookie"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174457997214,"lsrc":80972326202,"ltgt":31622557668,"luuu":"support.google.com/chrome/answer/95626?hl=en","pda":100,"ueid":355370,"uid":358079,"ulc":1394603890,"umrp":7.348021108330069,"umrr":4.2306065019844527e-07,"upa":95.04277845195264,"us":200,"ut":"HTTP cookie - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/HTTP_cookie"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174704422109,"lsrc":80972326202,"ltgt":31675615115,"luuu":"www.google.com/support/chrome/bin/answer.py?hl=en&answer=95582","pda":100,"ueid":355370,"uid":358079,"ulc":1394603890,"umrp":7.348021108330069,"umrr":4.2306065019844527e-07,"upa":95.04277845195264,"us":200,"ut":"HTTP cookie - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/HTTP_cookie"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174704422260,"lsrc":80972326202,"ltgt":31675615123,"luuu":"www.google.com/support/chrome/bin/answer.py?hl=en&answer=95626","pda":100,"ueid":355370,"uid":358079,"ulc":1394603890,"umrp":7.348021108330069,"umrr":4.2306065019844527e-07,"upa":95.04277845195264,"us":200,"ut":"HTTP cookie - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/HTTP_cookie"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174051896270,"lsrc":80975346908,"ltgt":31567049373,"luuu":"books.google.com/?id=0IZboamhb5EC&lpg=PA731","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174051900386,"lsrc":80975346908,"ltgt":31567051168,"luuu":"books.google.com/?id=58KxPNa0hF4C&lpg=PA463","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174051902110,"lsrc":80975346908,"ltgt":31567051879,"luuu":"books.google.com/?id=6xiYiybkE8kC&vq=core","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174051902955,"lsrc":80975346908,"ltgt":31567052243,"luuu":"books.google.com/?id=7veohk0fkLYC&lpg=PA88","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174051904343,"lsrc":80975346908,"ltgt":31567052883,"luuu":"books.google.com/?id=9iQYSQ9y60MC&lpg=PA49","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174051905960,"lsrc":80975346908,"ltgt":31567053635,"luuu":"books.google.com/?id=BgZyXNIrvB4C&pg=PT12","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174051911261,"lsrc":80975346908,"ltgt":31567055934,"luuu":"books.google.com/?id=Ho_RmgOnwgwC&lpg=PA8","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174051913146,"lsrc":80975346908,"ltgt":31567056717,"luuu":"books.google.com/?id=JttyjBoyb3AC&lpg=PA12","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174051920509,"lsrc":80975346908,"ltgt":31567059840,"luuu":"books.google.com/?id=SF7U27JsLC4C&dq=iraq+invasion+removes+hussein","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174051921673,"lsrc":80975346908,"ltgt":31567060362,"luuu":"books.google.com/?id=T_0TrXXiDbUC&dq=slavery+%22American+Civil+War%22","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174051922547,"lsrc":80975346908,"ltgt":31567060715,"luuu":"books.google.com/?id=UYpVAAAAYAAJ","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174051925466,"lsrc":80975346908,"ltgt":31567061980,"luuu":"books.google.com/?id=Y1dOLQN9hvwC&dq=SEALs+kill+Osama+bin+Laden","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174051936195,"lsrc":80975346908,"ltgt":31567066473,"luuu":"books.google.com/?id=jLy-NKnQitIC&pg=PA45&dq=uk+us+special+relationship","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174051937261,"lsrc":80975346908,"ltgt":31567066890,"luuu":"books.google.com/?id=ka6LxulZaEwC&vq=annexation&dq=territorial+expansion+United+States+%22manifest+destiny%22","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174051943179,"lsrc":80975346908,"ltgt":31567069364,"luuu":"books.google.com/?id=r71u_AgE7iYC&lpg=PA142","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174051949934,"lsrc":80975346908,"ltgt":31567072219,"luuu":"books.google.com/?id=yd4GqkP5XYgC&lpg=PA229","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174051950951,"lsrc":80975346908,"ltgt":31567072673,"luuu":"books.google.com/?id=zq4rsWNrYo4C&q=Reaganomics&dq=Reaganomics","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174052414947,"lsrc":80975346908,"ltgt":31567405066,"luuu":"books.google.com/books/about/A_History_of_the_American_People.html?id=RXSVQjz1_tMC","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174052676940,"lsrc":80975346908,"ltgt":31567608329,"luuu":"books.google.com/books/about/An_Empire_of_Wealth.html?id=rmsUs_KDgHAC","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"},{"fmrp":8.770560720053982,"fmrr":7.78614635427592e-05,"lrid":174054227159,"lsrc":80975346908,"ltgt":31568894639,"luuu":"books.google.com/books/about/History_of_the_American_Economy_With_Acc.html?id=lyhI1q_E4G0C","pda":100,"ueid":73314,"uid":156486,"ulc":1393624567,"umrp":6.978036065267593,"umrr":1.3614443568106348e-07,"upa":94.43262161988372,"us":200,"ut":"United States - Wikipedia, the free encyclopedia","uu":"en.wikipedia.org/wiki/United_States"}]'; $array = json_decode($string,true); echo '<pre>'; var_dump($array); Quote Link to comment https://forums.phpfreaks.com/topic/288588-regex-help/#findComment-1479990 Share on other sites More sharing options...
Psycho Posted May 19, 2014 Share Posted May 19, 2014 (edited) Building upon mac_gyver's response: $inputArray = json_decode($string, true); $uuVals = array_map(function ($var) {return $var['uu'];}, $inputArray); echo '<pre>' . print_r($uuVals, 1) . "</pre>"; Output Array ( [0] => en.wikipedia.org/wiki/HTTP_cookie [1] => en.wikipedia.org/wiki/HTTP_cookie [2] => en.wikipedia.org/wiki/HTTP_cookie [3] => en.wikipedia.org/wiki/HTTP_cookie [4] => en.wikipedia.org/wiki/HTTP_cookie [5] => en.wikipedia.org/wiki/United_States [6] => en.wikipedia.org/wiki/United_States [7] => en.wikipedia.org/wiki/United_States [8] => en.wikipedia.org/wiki/United_States [9] => en.wikipedia.org/wiki/United_States [10] => en.wikipedia.org/wiki/United_States [11] => en.wikipedia.org/wiki/United_States [12] => en.wikipedia.org/wiki/United_States [13] => en.wikipedia.org/wiki/United_States [14] => en.wikipedia.org/wiki/United_States [15] => en.wikipedia.org/wiki/United_States [16] => en.wikipedia.org/wiki/United_States [17] => en.wikipedia.org/wiki/United_States [18] => en.wikipedia.org/wiki/United_States [19] => en.wikipedia.org/wiki/United_States [20] => en.wikipedia.org/wiki/United_States [21] => en.wikipedia.org/wiki/United_States [22] => en.wikipedia.org/wiki/United_States [23] => en.wikipedia.org/wiki/United_States [24] => en.wikipedia.org/wiki/United_States ) You can remove the duplicates, if needed, using array_unique() Edited May 19, 2014 by Psycho Quote Link to comment https://forums.phpfreaks.com/topic/288588-regex-help/#findComment-1480002 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.