Skip to content

Commit

Permalink
Readme updated
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroendesloovere committed May 20, 2015
1 parent bef6b77 commit ca49007
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,24 @@ $items = array(
**Get distance between two locations**

```php
$distance = Distance::between($latitude1, $longitude1, $latitude2, $longitude2);
$distance = Distance::between(
$latitude1,
$longitude1,
$latitude2,
$longitude2
);

// dump data
echo 'Distance between the two locations = ' . $distance . ' km';
```

**Get closest distance from location 1 to one of the two locations (2 and 3)**
```php
$distance = Distance::getClosest($latitude1, $longitude1, $items);
$distance = Distance::getClosest(
$latitude1,
$longitude1,
$items
);

// dump data
echo 'The closest location to location 1 is ' . $distance['title'] . ' and the distance between them is ' . $distance['distance'] . ' km';
Expand Down

0 comments on commit ca49007

Please sign in to comment.