Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

PHP Echo variable in API request

Posted on 2014-10-26
3
Medium Priority
?
145 Views
Last Modified: 2014-10-26
How can I echo $lat and $long in this request?

$bizArray = file_get_contents("https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=location=".$lat.",".$long."&radius=3000&key=");

Open in new window

0
Comment
Question by:seopti
  • 2
3 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 40405263
What do you mean echo them?

(You have location twice)
0
 

Author Comment

by:seopti
ID: 40405267
I would like to use:

echo $lat;
echo $long;

in the API query string. Thanks for the location info, yes this is a mistake.
0
 
LVL 58

Accepted Solution

by:
Gary earned 2000 total points
ID: 40405270
You don't use echo, as you already have it is correct.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question