Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "points": [
- [52.93839800000001,-1.1425212999999999],
- [52.93839800000001,-1.1425212999999999],
- [52.93839800000001,-1.1425212999999999],
- [52.93839800000001,-1.1425212999999999],
- [52.93839800000001,-1.1425212999999999]
- ]
- }
- $sql = "SELECT latlong from requests";
- $result = $con->query($sql);
- if ($result->num_rows > 0) {
- // output data of each row
- while($row = $result->fetch_assoc()) {
- echo $row['latlong'] . "<br>";
- }
- } else {
- echo "0 results";
- }
- $con->close();
- $str = '{
- "points": [
- [52.93839800000001,-1.1425212999999999],
- [52.93839800000001,-1.1425212999999999],
- [52.93839800000001,-1.1425212999999999],
- [52.93839800000001,-1.1425212999999999],
- [52.93839800000001,-1.1425212999999999]
- ]
- }';
- $arr = json_decode($str,true); // decode to array
- foreach($arr["points"] as $row){ // loop points array
- echo "lat " . $row[0] . "n";
- echo "lon " . $row[1] . "nn";
- }
- lat 52.938398
- lon -1.1425213
- lat 52.938398
- lon -1.1425213
- lat 52.938398
- lon -1.1425213
- lat 52.938398
- lon -1.1425213
- lat 52.938398
- lon -1.1425213
Add Comment
Please, Sign In to add comment