Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // https://morillasweb.com/index.php/2018/07/27/convert-google-sheet-to-sqlite/
- // detect first row as column names if gSheet API doesn't
- $colNames = '';
- foreach ($table->cols as $aCol) {
- $colNames .= $aCol->label;
- }
- if ($colNames =='') {
- $firstRow = array_shift($table->rows);
- foreach ($table->cols as $key=>$aCol) {
- $colNames .= $aCol->label;
- $table->cols[$key]->label = $firstRow->c[$key]->v;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment