[英]Google places API using PHP
我絕對是使用 API 的新手。 我有這個代碼:
<head>
<script src="https://maps.googleapis.com/maps/api/js?sensor=false&libraries=places"></script>
<script type="text/javascript">
function initialize() {
var input = document.getElementById('searchTextField');
var options = {componentRestrictions: {country: 'ru'}};
new google.maps.places.Autocomplete(input, options);
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>
<label for="searchTextField">Please insert an address:</label>
<input id="searchTextField" type="text" size="50">
</body>
所以我想知道我是否可以做 JS 在這里用 PHP 做的類似的事情。 也許有一些關於它的很好的教程(我搜索了很多地方,但找不到好的)。 或者我可能遺漏了一些類似的東西……在 PHP 中有一些使用 API 的一般規則或方法,如果我知道它們,我就會理解如何在 PHP 中使用 Google Places API(借助 Google 文檔中提供的信息) . 類似的東西? 我發現的大多數分步指南和示例都在 JS 中。 甚至在 Google 文檔本身中。 不是有 PHP 的東西嗎? 請! 任何幫助都是寶貴的。 謝謝。
通過為 Google Places API使用PHP 包裝器,您將節省大量時間。
你可以把這個https://github.com/digitaldreams/googleplace它的純 PHP 庫。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.