PHP/Codeigniterを使用しており、Google APIs Client Library for PHPで作業していますが、多次元配列からデータを出力しようとしています。多次元連想配列出力
私のコントローラ私は持っています;私ビューで
$client = new Google_Client();
$client->setApplicationName("Client_Library_Examples");
$client->setDeveloperKey("MyKey");
$service = new Google_Service_Books($client);
$data = array(
'title' => 'Library Items',
'gbook' => $service->volumes->listVolumes('0-7515-3831-0')
);
私が持っています。私print_r($gbook)
が私の見解で、私は、私はこの配列(すなわちtitle
とisbn
)から特定の値を選択するかどうかはわかりません、次のhttps://pastebin.com/HM5hds6e
を参照してください
echo 'Page Title is: ' .$title; // this successfully prints 'Library Items'
echo 'Book Title is: '; // need to output the book title here
echo 'Description is: '; // need to output the book description here
。どんな助けやヒントもありがとう!
おかげ
1つの本または書籍のリストを取得しようとしていますか? '$ service-> volumes-> listVolumes( 'Harry Potter')は、 'Harry Potter'と一致するすべてのボリュームを含む* Google_Service_Books_Volumes *オブジェクトを返しますので、単一のボリューム/ブックではありません。 –
私の答えのコードを参照して、動作するか確認してください。 –