如何在位置天气搜索表单“API 支持阿拉伯语语言”中获取阿拉伯语结果
当我输入阿拉伯城市名称时,我有英语语言的天气结果当我直接用阿拉伯城市名称替换链接中的位置名称时没有结果我有我需要的所有信息但是当我使用搜索表单时我有结果en lang 下面的代码.. 我该怎么做才能用 ar lang 获得结果!
<meta charset="utf-8">
<main class="container text-center"
<h1 class="display-1">حالة الطقس</h1>
<form class="form-inline" method="post">
<div class="form-group mx-auto my-5">
<label class="sr-only" for="location">يرجى ادخال موقعك</label>
<input tupe="text" class="form-control" id="location" placeholder="location" name="location" size="100%">
<button class ="btn btn-primary" type="submit">ابحث الان</button>
</div>
</form>
----
$location = htmlentities($_POST['location']);
$location = str_replace(' ', '+', $location);
$geocode_url = 'https ://geocoder.api.here.com/6.2/geocode.json?searchtext='.$location.'&app_id=XXX&app_code=XXX';
$location_data = json_decode(file_get_contents($geocode_url));