forked from DraXus/nhtg14
-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.php
17 lines (15 loc) · 848 Bytes
/
api.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php
$lat = $_GET["lat"];
$lng = $_GET["lng"];
$limit = $_GET["limit"];
$ch = curl_init('http://api.ratings.food.gov.uk/Establishments?longitude='.$lng.'&latitude='.$lat.'&maxDistanceLimit='.$limit.'&pageSize=20&pageNumber=1');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'x-api-version: ' . 2)
);
$result = curl_exec($ch);
header('Content-type: application/json');
echo $result;
?>