Last active
December 20, 2015 01:29
-
-
Save takashicompany/6048945 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//======スプレッドシートの取得 ここから====== | |
require './hoge/Ghostsheet.php'; | |
$gs = new Ghostsheet(); | |
$gs->set('cache', './hoge'); | |
$mySpreadsheetId = 'hogehogehoge'; //スプレッドシートのIDを設定 | |
$data = $gs->load($mySpreadsheetId); // $dataに加工されたデータが格納されます | |
//======スプレッドシートの取得 ここまで====== | |
//======JSON化 ここから====== | |
$log_all = $data['items']; //スプレッドシートのデーターを連想配列型で取得。 | |
$json_hash = json_encode($log_all); //連想配列をJSON型文字列へ変換。 | |
echo $json_hash; //JSON文字列を出力。 | |
//======JSON化 ここまで====== | |
?> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment