So I recently changed where my site is hosted, and my yp.com
API requests are being thrown off, perhaps by a new version of PHP.
http://api2.yp.com/listings/v1/search?searchLoc=oklahoma%20ok&term=Plumbing&format=xml&key=xxxx&sort=name&listingcount=50&pagenum=1
works great, even just by typing it into the URL.
But now in my PHP script, when I build the URL it automatically changes all &
into &
.
So if I type:
api.com/bla?var1=xxx&var2=yyy
even in the browser I get errors.
So I need for PHP to not change this in the URL, or I can't talk to the API I'm using.
I've looked all over the stacks for this and found similar questions but no resuts.
Here's my code
$apiURL = "http://api2.yp.com/listings/v1/search?searchLoc=oklahoma%20ok&term=Plumbing&format=xml&key=xxx&sort=name&listingcount=50&pagenum=1";
file_get_contents($apiURL);