With isset() you are checking for !isset($result[$key]) with $key and assigning with variable $value as index to $result[$value] = "0:00"; hence value not setting properly. Please make following changes in our code If you want value in $key to be set as index of $result. foreach($result as $key => $value)...
In the end I'm ending with something like this(very raw code so far, but enought for those who's seaching for solution. You need php google spreadsheet client of https://github.com/asimlqt/php-google-spreadsheet-client). Thats tiny example of inserting one row to my spreadsheet (sorry about my code, but showing just working example) Thanks for...