如何访问PHP中的Google Spreadsheets API? [英] How do I access the Google Spreadsheets API in PHP?

查看:92
本文介绍了如何访问PHP中的Google Spreadsheets API?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从Google开发人员 Google Spreadsheets API上的文档开始,我发现许多客户端库都以各种语言提供,但Google仅为Java和.NET提供客户端库。对于PHP库,他们推荐使用Zend GData。所以,我转向了 Zend GData回购,Zend表示他们的GData组件已经停产,并且要使用适用于PHP的Google API客户端库。该库不适用于Spreadsheets API,因为您必须返回到我开始使用的原始页面。



因此,似乎每个人都通过降压。我只需要编写一些PHP代码来请求和处理Google Spreadsheet中的数据。我怎么做?请不要将我链接到类似的帖子或页面,而不检查它们是否100%是最新的,我已经查阅了大量的帖子,几个小时都满了过时和不赞成的依赖项。 解决方案

rel =noreferrer> PHP Google Spreadsheet Client库。



您需要使用 PHP的Google API客户端库以及通过OAuth2进行身份验证。开发者文档链接在github页面上。


Starting with the Google Developer documentation on the Google Spreadsheets API, I found that "A number of client libraries are provided in various languages.", but Google only provides client libraries for Java and .NET. For a PHP library, they recommend using Zend GData. So, I headed over the the Zend GData repo, and Zend says that their GData component is discontinued, and to use Google APIs Client Library for PHP. That library doesn't work with the Spreadsheets API, for that you have to go back to the original page that I started with.

So, it seems like everyone's passing the buck. I just need to write some PHP code that requests and processes data from a Google Spreadsheet. How do I do that? Please don't link me to similar posts or pages without checking to be sure that they are 100% up to date, I've been sifting through a huge mess of posts for hours that are all full of outdated and deprecated dependencies.

解决方案

You can use the PHP Google Spreadsheet Client library.

You'll need to use the Google APIs Client Library for PHP as well to authenticate via OAuth2. Developer documentation is linked on the github page.

这篇关于如何访问PHP中的Google Spreadsheets API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆