Solved

PHP Echo variable in API request

Posted on 2014-10-26
3
131 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
php date - compare 4 40
php call to a non-object 3 34
Move wordpress site 3 24
Split long text string into shorter chunks 7 23
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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 …

867 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now