如何解析Google Play网页中的JSON数据?

时间:2015-06-27 10:56:52

标签: php html json curl google-play

我使用curl获取在Google Play应用的网页中使用的POST数据。

返回数据是一种特殊的JSON格式。有没有办法在PHP中解析或解码它?感谢。

<?php
    $url = 'https://play.google.com/store/xhr/getdoc?authuser=0&ids=com.facebook.lite&xhr=1&hl=en';
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLOPT_HEADER, false);
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
    $data = curl_exec($curl);
    curl_close($curl);
    print_r($data);
?>

返回的数据:

)]}'

[["gdar",1,[["com.facebook.lite","com.facebook.lite",1,3,"/store/apps/details?id\u003dcom.facebook.lite","/store/apps/details?id\u003dcom.facebook.lite","https://play.google.com/store/apps/details?id\u003dcom.facebook.lite","https://market.android.com/details?id\u003dcom.facebook.lite","Facebook Lite","This version of Facebook is efficient with data and works in all network conditions.\u003cp\u003eFacebook Lite:\u003cbr\u003e- Installs quickly — the app is less than 1 MB\u003cbr\u003e- Works on all Android phones\u003cbr\u003e- Uses less data\u003cbr\u003e- Is designed for 2G networks and areas with slow or unstable connections\u003cp\u003eFor the full Facebook app, install Facebook for Android: \u003ca href\u003d\"https://www.google.com/url?q\u003dhttps://www.google.com/url?q%3Dhttp://bit.ly/18exgL6%26sa%3DD%26usg%3DAFQjCNF5dID3lNfcKQQukollBpKGGgd0Aw\u0026amp;sa\u003dD\u0026amp;usg\u003dAFQjCNHTBnSv68tgx06a5wmCR_ZlQizWIA\" target\u003d\"_blank\"\u003ehttp://bit.ly/18exgL6\u003c/a\u003e\u003cp\u003eKeeping up with friends is faster than ever. Facebook is free and always will be.\u003cp\u003eAbout Facebook:\u003cbr\u003e- Message friends and have group conversations\u003cbr\u003e- Get notifications when friends like and comment on your posts\u003cbr\u003e- See what friends are up to\u003cbr\u003e- Share updates and photos\u003cp\u003e\u003cbr\u003eProblems downloading or installing the app? See \u003ca href\u003d\"https://www.google.com/url?q\u003dhttps://www.google.com/url?q%3Dhttps://www.facebook.com/help/fblite%26sa%3DD%26usg%3DAFQjCNGm1NY4z3pOWDW5RyiQEY7SG-LIDQ\u0026amp;sa\u003dD\u0026amp;usg\u003dAFQjCNElCyAEoB8tzMk-QfFRT0eFtRl9Hw\" target\u003d\"_blank\"\u003ehttps://www.facebook.com/help/fblite\u003c/a\u003e\u003cbr\u003eStill need help? Please tell us more about the issue: \u003ca href\u003d\"https://www.google.com/url?q\u003dhttps://www.google.com/url?q%3Dhttps://www.facebook.com/help/contact/640732869364975%26sa%3DD%26usg%3DAFQjCNGLNSzNXqLepbs9BrFLwfvehbvqdA\u0026amp;sa\u003dD\u0026amp;usg\u003dAFQjCNFlBsx8yMvi5AGrHg6gkWV2EkuUXw\" target\u003d\"_blank\"\u003ehttps://www.facebook.com/help/contact/640732869364975\u003c/a\u003e\u003cbr\u003eFacebook is only available for people ages 13 and over.\u003cbr\u003eTerms of Service: \u003ca href\u003d\"https://www.google.com/url?q\u003dhttps://www.google.com/url?q%3Dhttp://m.facebook.com/terms.php%26sa%3DD%26usg%3DAFQjCNGrqpuQ6bO8akXW353UTrOXgTz_mA\u0026amp;sa\u003dD\u0026amp;usg\u003dAFQjCNEyhIEGQvhfO3mh3GAqjWz3Tj_JqA\" target\u003d\"_blank\"\u003ehttp://m.facebook.com/terms.php\u003c/a\u003e\u003c/p\u003e\u003c/p\u003e\u003c/p\u003e\u003c/p\u003e\u003c/p\u003e",,[[4,,,,"https://lh3.googleusercontent.com/Alon4Gigwl2DqrT36O6JMn-M40tinuxFHWROtv0TP8ozX8Sr5MiBM1CuHX-veqFhnKvQ",,"https://lh3.googleusercontent.com/Alon4Gigwl2DqrT36O6JMn-M40tinuxFHWROtv0TP8ozX8Sr5MiBM1CuHX-veqFhnKvQ",,1]
,[2,,,,"https://lh3.googleusercontent.com/guyuxM-nmAw-ztRzheL-_rkIn3qgExtS9pp7rPBv-cNkOFRbk_C9hMY9L7k7or4noaA",,"https://lh3.googleusercontent.com/guyuxM-nmAw-ztRzheL-_rkIn3qgExtS9pp7rPBv-cNkOFRbk_C9hMY9L7k7or4noaA",,1]
,[1,,,,"https://lh3.googleusercontent.com/lLixN9tlQ7YiIXg3nj5LQ1OcrEuxNsEnXwSSYyZxLGiP6lDb24KrOvG3pWhGb7zj7Jc",,"https://lh3.googleusercontent.com/lLixN9tlQ7YiIXg3nj5LQ1OcrEuxNsEnXwSSYyZxLGiP6lDb24KrOvG3pWhGb7zj7Jc",0,1]
,[1,,,,"https://lh3.googleusercontent.com/0kCb12i0aWOd9kqENWZn3fftY64ENZVtyGUN46dVm_WyDbUbvgA_WC9TBl8GxqOjdg",,"https://lh3.googleusercontent.com/0kCb12i0aWOd9kqENWZn3fftY64ENZVtyGUN46dVm_WyDbUbvgA_WC9TBl8GxqOjdg",1,1]
,[1,,,,"https://lh3.googleusercontent.com/vhcIVqU2yfMR28CRwXOMXAcDw_z0UWWy2d-F9eE8jOwz0jsG1lxWBR1q4NCaMSFg08k",,"https://lh3.googleusercontent.com/vhcIVqU2yfMR28CRwXOMXAcDw_z0UWWy2d-F9eE8jOwz0jsG1lxWBR1q4NCaMSFg08k",2,1]
,[1,,,,"https://lh3.googleusercontent.com/PIQ3ccSXjfQPbuemLDvMnj38uDfRpXL-qcn1tiERaLIhFly0446K46HUqF_jca6LdEs",,"https://lh3.googleusercontent.com/PIQ3ccSXjfQPbuemLDvMnj38uDfRpXL-qcn1tiERaLIhFly0446K46HUqF_jca6LdEs",3,1]
]
,,[["com.facebook.lite","Free","",,0,0,1,,"https://play.google.com/store/apps/details?id\u003dcom.facebook.lite\u0026rdid\u003dcom.facebook.lite\u0026rdot\u003d1\u0026feature\u003dmd",,,,,,,0,,,,,,,,,"Free","USD","Install",0,,,"0",,,"USD",0,,,""]
]
,[["Social","/store/apps/category/SOCIAL"]
]
,[0,0,0,0,0,0,0,,0,0,,,,0]
,4.3318954,103141,"https://lh3.googleusercontent.com/Alon4Gigwl2DqrT36O6JMn-M40tinuxFHWROtv0TP8ozX8Sr5MiBM1CuHX-veqFhnKvQ\u003dw150","apps",[[1,,,,"https://lh3.googleusercontent.com/lLixN9tlQ7YiIXg3nj5LQ1OcrEuxNsEnXwSSYyZxLGiP6lDb24KrOvG3pWhGb7zj7Jc",,"https://lh3.googleusercontent.com/lLixN9tlQ7YiIXg3nj5LQ1OcrEuxNsEnXwSSYyZxLGiP6lDb24KrOvG3pWhGb7zj7Jc",0,1]
,[1,,,,"https://lh3.googleusercontent.com/0kCb12i0aWOd9kqENWZn3fftY64ENZVtyGUN46dVm_WyDbUbvgA_WC9TBl8GxqOjdg",,"https://lh3.googleusercontent.com/0kCb12i0aWOd9kqENWZn3fftY64ENZVtyGUN46dVm_WyDbUbvgA_WC9TBl8GxqOjdg",1,1]
,[1,,,,"https://lh3.googleusercontent.com/vhcIVqU2yfMR28CRwXOMXAcDw_z0UWWy2d-F9eE8jOwz0jsG1lxWBR1q4NCaMSFg08k",,"https://lh3.googleusercontent.com/vhcIVqU2yfMR28CRwXOMXAcDw_z0UWWy2d-F9eE8jOwz0jsG1lxWBR1q4NCaMSFg08k",2,1]
,[1,,,,"https://lh3.googleusercontent.com/PIQ3ccSXjfQPbuemLDvMnj38uDfRpXL-qcn1tiERaLIhFly0446K46HUqF_jca6LdEs",,"https://lh3.googleusercontent.com/PIQ3ccSXjfQPbuemLDvMnj38uDfRpXL-qcn1tiERaLIhFly0446K46HUqF_jca6LdEs",3,1]
]
,,"103,141","4.3",[[["67,840","100%"]
,["16,865","24%"]
,["9,033","13%"]
,["3,634","5%"]
,["5,769","8%"]
]
]
,,[["Top Developer",[[5,[11,11,,,,,,,,,,,,,,0]
,,,"http://lh3.ggpht.com/STkLA3lthJ3mrb1mScEIdKgag30BABVWAz3m-zTnwTeUShZIZz8fAkQR0tgCe4GLSEY",,"https://lh3.ggpht.com/STkLA3lthJ3mrb1mScEIdKgag30BABVWAz3m-zTnwTeUShZIZz8fAkQR0tgCe4GLSEY",,1]
,[6,[24,24,,,,,,,,,,,,,,0]
,,,"http://lh3.ggpht.com/STkLA3lthJ3mrb1mScEIdKgag30BABVWAz3m-zTnwTeUShZIZz8fAkQR0tgCe4GLSEY",,"https://lh3.ggpht.com/STkLA3lthJ3mrb1mScEIdKgag30BABVWAz3m-zTnwTeUShZIZz8fAkQR0tgCe4GLSEY",,1]
,[7,[28,33,,,,,,,,,,,,,,0]
,,,"http://lh3.ggpht.com/STkLA3lthJ3mrb1mScEIdKgag30BABVWAz3m-zTnwTeUShZIZz8fAkQR0tgCe4GLSEY",,"https://lh3.ggpht.com/STkLA3lthJ3mrb1mScEIdKgag30BABVWAz3m-zTnwTeUShZIZz8fAkQR0tgCe4GLSEY",,1]
]
,,"topDeveloperBadgeUrl","https://ssl.gstatic.com/android/market_images/badges/topdev_ann.png"]
]
,"Free",[]
,[]
,,,,,,,[]
,,,[]
,,"This version of Facebook is efficient with data and works in all network conditions.\u003cp\u003eFacebook Lite:\u003cbr\u003e- Installs quickly — the app is less than 1 MB\u003cbr\u003e- Works on all Android phones\u003cbr\u003e- Uses less data\u003cbr\u003e- Is designed for 2G networks and areas with slow or unstable connections\u003cp\u003eFor the full Facebook app, install Facebook for Android: http://bit.ly/18exgL6\u003cp\u003eKeeping up with friends is faster than ever. Facebook is free and always will be.\u003cp\u003eAbout Facebook:\u003cbr\u003e- Message friends and have group conversations\u003cbr\u003e- Get notifications when friends like and comment on your posts\u003cbr\u003e- See what friends are up to\u003cbr\u003e- Share updates and photos\u003cp\u003e\u003cbr\u003eProblems downloading or installing the app? See https://www.facebook.com/help/fblite\u003cbr\u003eStill need help? Please tell us more about the issue: https://www.facebook.com/help/contact/640732869364975\u003cbr\u003eFacebook is only available for people ages 13 and over.\u003cbr\u003eTerms of Service: http://m.facebook.com/terms.php\u003c/p\u003e\u003c/p\u003e\u003c/p\u003e\u003c/p\u003e\u003c/p\u003e",0,,,,[]
,,0,0,,0,,1,0,{"42656262":[["Facebook","/store/apps/developer?id\u003dFacebook"]
,[[[,[["retrieve running apps","Allows the app to retrieve information about currently and recently running tasks. This may allow the app to discover information about which applications are used on the device.",1]
]
,1]
,[,[["find accounts on the device","Allows the app to get the list of accounts known by the device. This may include any accounts created by applications you have installed.",1]
,["read your own contact card","Allows the app to read personal profile information stored on your device, such as your name and contact information. This means the app can identify you and may send your profile information to others.",1]
]
,3]
,[,[["read calendar events plus confidential information","Allows the app to read all calendar events stored on your device, including those of friends or co-workers. This may allow the app to share or save your calendar data, regardless of confidentiality or sensitivity.",1]
,["add or modify calendar events and send email to guests without owners' knowledge","Allows the app to add, remove, change events that you can modify on your device, including those of friends or co-workers. This may allow the app to send messages that appear to come from calendar owners, or modify events without the owners' knowledge.",1]
]
,4]
,[,[["read your contacts","Allows the app to read data about your contacts stored on your device, including the frequency with which you've called, emailed, or communicated in other ways with specific individuals. This permission allows apps to save your contact data, and malicious apps may share contact data without your knowledge.",1]
,["modify your contacts","Allows the app to modify the data about your contacts stored on your device, including the frequency with which you've called, emailed, or communicated in other ways with specific contacts. This permission allows apps to delete contact data.",1]
]
,5]
,[,[["approximate location (network-based)","Allows the app to get your approximate location. This location is derived by location services using network location sources such as cell towers and Wi-Fi. These location services must be turned on and available to your device for the app to use them. Apps may use this to determine approximately where you are.",1]
,["precise location (GPS and network-based)","Allows the app to get your precise location using the Global Positioning System (GPS) or network location sources such as cell towers and Wi-Fi. These location services must be turned on and available to your device for the app to use them. Apps may use this to determine where you are, and may consume additional battery power.",1]
]
,6]
,[,[["read your text messages (SMS or MMS)","Allows the app to read SMS messages stored on your device or SIM card. This allows the app to read all SMS messages, regardless of content or confidentiality.",1]
]
,7]
,[,[["directly call phone numbers","Allows the app to call phone numbers without your intervention. This may result in unexpected charges or calls. Note that this doesn't allow the app to call emergency numbers. Malicious apps may cost you money by making calls without your confirmation.",1]
]
,8]
,[,[["modify or delete the contents of your USB storage","Allows the app to write to the USB storage.",1]
,["read the contents of your USB storage","Allows the app to read the contents of your USB storage.",1]
]
,9]
,[,[["take pictures and videos","Allows the app to take pictures and videos with the camera. This permission allows the app to use the camera at any time without your confirmation.",1]
]
,10]
,[,[["record audio","Allows the app to record audio with the microphone. This permission allows the app to record audio at any time without your confirmation.",1]
]
,11]
,[,[["view Wi-Fi connections","Allows the app to view information about Wi-Fi networking, such as whether Wi-Fi is enabled and name of connected Wi-Fi devices.",1]
]
,12]
,[,[["read phone status and identity","Allows the app to access the phone features of the device. This permission allows the app to determine the phone number and device IDs, whether a call is active, and the remote number connected by a call.",1]
]
,13]
]
,[[,[["view network connections","Allows the app to view information about network connections such as which networks exist and are connected.",0]
,["read battery statistics","Allows an application to read the current low-level battery use data. May allow the application to find out detailed information about which apps you use.",0]
,["send sticky broadcast","Allows the app to send sticky broadcasts, which remain after the broadcast ends. Excessive use may make the device slow or unstable by causing it to use too much memory.",0]
,["change network connectivity","Allows the app to change the state of network connectivity.",0]
,["connect and disconnect from Wi-Fi","Allows the app to connect to and disconnect from Wi-Fi access points and to make changes to device configuration for Wi-Fi networks.",0]
,["full network access","Allows the app to create network sockets and use custom network protocols. The browser and other applications provide means to send data to the internet, so this permission is not required to send data to the internet.",0]
,["run at startup","Allows the app to have itself started as soon as the system has finished booting. This can make it take longer to start the device and allow the app to slow down the overall device by always running.",0]
,["draw over other apps","Allows the app to draw on top of other applications or parts of the user interface. They may interfere with your use of the interface in any application, or change what you think you are seeing in other applications.",0]
,["control vibration","Allows the app to control the vibrator.",0]
,["prevent device from sleeping","Allows the app to prevent the device from going to sleep.",0]
,["install shortcuts","Allows an app to add shortcuts without user intervention.",0]
,["uninstall shortcuts","Allows the app to remove shortcuts without user intervention.",0]
]
]
]
,[["receive data from Internet","Allows apps to accept cloud to device messages sent by the app's service. Using this service will incur data usage. Malicious apps could cause excess data usage.",1]
]
,[]
]
,"May 29, 2015",3,"435k","5,000,000","10,000,000","1.10.0.55.128",0,"2.2",,["- Push notifications now available on all phones","- Improvements to make the app faster on slow connections"]
,"https://www.google.com/url?q\u003dhttps://www.facebook.com/facebook\u0026sa\u003dD\u0026usg\u003dAFQjCNGRHFFrpM0oatFPPR2o-FZgqzAIvg","https://www.google.com/url?q\u003dhttps://www.facebook.com/about/privacy/\u0026sa\u003dD\u0026usg\u003dAFQjCNGsgQ5qAO5ohRTZIcLRwgVSGnkqww","lite-android-support@fb.com",,,,,,,["Rated for 12+","Parental Guidance Recommended",[,[512,366,,,,,,,,,,,,,,0]
,,,"http://lh4.ggpht.com/0fpT4ETDcjnap5Agy6esUKHMGKNcLpuW3TeJDyg-KU7We9jMxG71XEDNRUE1PtIFfJwRBw",,,,1]
,,"Users Interact, Shares Info, Shares Location"]
]
}]
]
]
]

0 个答案:

没有答案