0

I have a google maps api, from which I can convert the area name from latitude and longitude. Code given bellow :

<?php
$url="https://maps.google.com/maps/api/geocode/json?latlng=23.756879299999998,90.3801968&key=key";

Now I want to make this $url dynamically. Here I have latlng= 23.756879299999998,90.3801968 I want to make it like this latlng = $lat,$long

How I can make this

1 Answer 1

1

you could use a simple string concat eg:

<?php
$lat= "23.756879299999998";
$lng = "90.3801968";

$url="https://maps.google.com/maps/api/geocode/json?latlng=".$lat.",".$lng."&key=key";
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.