Using Google Books API

前端 未结 2 1925
刺人心
刺人心 2021-01-07 14:36

I\'m having trouble using the Google Books API

I am inexperienced in working with JSON.

My form:

2条回答
  •  灰色年华
    2021-01-07 14:52

    Well you ale retrieving the JSON info so that's the hard part.

    In order to print the data via php try something like the following;

    $page = file_get_contents($page);
    
    $data = json_decode($page, true);
    
    echo "Title = " . $data['items'][0]['volumeInfo']['title'];
    echo "Authors = " . @implode(",", $data['items'][0]['volumeInfo']['authors']);    
    echo "Pagecount = " . $data['items'][0]['volumeInfo']['pageCount'];
    

提交回复
热议问题