質問編集履歴
2
環境を追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -4,6 +4,8 @@
|
|
4
4
|
|
5
5
|
言語はPHPです。
|
6
6
|
|
7
|
+
PHP5.4、windows10です。
|
8
|
+
|
7
9
|
実行結果が異なっているので、その画像を用意しました。
|
8
10
|
|
9
11
|
ローカルでの実行結果(正しい結果)
|
@@ -50,7 +52,7 @@
|
|
50
52
|
}
|
51
53
|
|
52
54
|
// apiのリクエストURL
|
53
|
-
$url = "https://maps.googleapis.com/maps/api/distancematrix/json?origins=".$post[0].'|'.$destination."&destinations=".$destination."&mode='".$mode."'&language=ja&key=
|
55
|
+
$url = "https://maps.googleapis.com/maps/api/distancematrix/json?origins=".$post[0].'|'.$destination."&destinations=".$destination."&mode='".$mode."'&language=ja&key=AIzaSyDkfDsdgdhfjgkhNl4wMj8rV3WTlg";
|
54
56
|
// jsonデータを文字列として読み込む
|
55
57
|
$json = file_get_contents($url);
|
56
58
|
// 文字化け対策
|
1
正しい実行結果の記載追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
実行結果が異なっているので、その画像を用意しました。
|
8
8
|
|
9
|
-
ローカルでの実行結果
|
9
|
+
ローカルでの実行結果(正しい結果)
|
10
10
|

|
11
11
|
|
12
12
|
レンタルサーバでの実行結果
|