Solved

PHP Echo variable in API request

Posted on 2014-10-26
3
132 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 500 total points
ID: 40405270
You don't use echo, as you already have it is correct.
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

770 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