...
This commit is contained in:
parent
1e22d28754
commit
6b926d3afe
126 changed files with 128562 additions and 104297 deletions
|
|
@ -0,0 +1,44 @@
|
|||
```php
|
||||
<!-- test1.php -->
|
||||
|
||||
<?php
|
||||
|
||||
//The URL with parameters / query string.
|
||||
// Escape: $str = preg_replace('/[^a-z\d ]/i', '', $str);
|
||||
|
||||
$url='https://api.tomtom.com/search/2/search/Am%20Kapellchen%2021%2C%2041470%20Neuss.json?lat=37.337&lon=-121.89&minFuzzyLevel=1&maxFuzzyLevel=2&view=Unified&relatedPois=off&key=xcA6NjLwDPmayP6y56AoVoloz1iohbUV';
|
||||
|
||||
//we use file_get_contents to GET the URL in question.
|
||||
$contents = file_get_contents($url);
|
||||
|
||||
$result = json_decode($contents);
|
||||
$lat = $result->results[0]->position->lat;
|
||||
$lon = $result->results[0]->position->lon;
|
||||
|
||||
echo "Lat=" . $lat . ", Lon=" . $lon;
|
||||
|
||||
```
|
||||
|
||||
````php
|
||||
<?php
|
||||
|
||||
//The URL with parameters / query string.
|
||||
|
||||
$url='https://api.tomtom.com/search/2/search/Am%20Kapellchen%2021%2C%2041470%20Neuss.json?lat=37.337&lon=-121.89&minFuzzyLevel=1&maxFuzzyLevel=2&view=Unified&relatedPois=off&key=xcA6NjLwDPmayP6y56AoVoloz1iohbUV';
|
||||
|
||||
//we use file_get_contents to GET the URL in question.
|
||||
$contents = file_get_contents($url);
|
||||
|
||||
//If $contents is not a boolean FALSE value.
|
||||
if($contents !== false){
|
||||
//Print out the contents.
|
||||
echo $contents;
|
||||
}
|
||||
```
|
||||
|
||||
````
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue