Skip to content
Advertisement

Add array form data in google sheets api through PHP

I am using google sheets API in PHP to add my html form data in google spreadsheet. All other data have been appended in the respective cell of the sheet since each value had single data except one data which is in array since the html input data is in multiple checkbox.

My google sheet form:

enter image description here

And my code in php :

JavaScript

My problem is in following code

JavaScript

Here $lessons is in array whose data should be populated either by comma or in list in I column of the spreadsheet.

Can I get solution on how to pass the array data?

Advertisement

Answer

To convert your array to a comma separate string use e.g. the implode method

Sample:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement