php - Decode G2A search results (json) to array -


help me grab name of games url

this page output json format. try convert array, code not work. please me!

$url = 'https://search.g2a.com/items/select?json.wrf=jquery111003403934023808688_1411464896728&q=not+type%3aindividual+and+(-type%3agaming+and+wholesaleqty%3a%5b1+to+*%5d+and+wholesaleminprice%3a%5b0+to+198%5d)&wt=json&start=0&rows=10000&sort=sortorder+desc&_=1411464896757'; $content = file_get_contents($url); $json = json_decode($content, true);  echo "<pre>"; print_r($json); echo "</pre>"; 

you should remove jsonp parameter json.wrf url first:

https://search.g2a.com/items/select?q=not+type%3aindividual+and+(-type%3agaming+and+wholesaleqty%3a%5b1+to+*%5d+and+wholesaleminprice%3a%5b0+to+198%5d)&wt=json&start=0&rows=10000&sort=sortorder+desc&_=1411464896757 

this return proper json result.


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -