gpt4 book ai didi

php - PHP 可以从 Firebase/Firestore 检索数据吗?

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:57:27 26 4
gpt4 key购买 nike

是否有用于将 php 连接到 Firebase Firestore 数据库的 PHP 库?PHP 甚至可以从 Firebase 检索数据吗?

最佳答案

是的,现在有一个PHP client library .

use Google\Cloud\Firestore\FirestoreClient;

$db = new FirestoreClient();

$citiesRef = $db->collection('cities');
$query = $citiesRef->where('state', '=', 'CA');
$snapshot = $query->documents();
foreach ($snapshot as $document) {
printf('Document %s returned by query state=CA' . PHP_EOL, $document->id());
}

您可以在我们的 documentation 中找到更多示例现在,只需选择片段上的 PHP 选项卡。

关于php - PHP 可以从 Firebase/Firestore 检索数据吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49226283/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com