Jump to content

How do I escape an ampersand in a url?


carlwenrich

Recommended Posts

Actually, I don't think so. I think that's for a different situation.

Here's the code:

 

$url = "http://finance.yahoo.com/q/op?s=BJS&m=2008-05";

$content = file_get_contents($url);

 

The page that gets returned is the one for this url:

 

http://finance.yahoo.com/q/op?s=BJS

 

which is the first month of options, whereas I need the second one.

I think thats his point. it's not taking the 2nd parameter.

 

for me it worked fine using php5 and php4.

 

<?php
  
   $url = "http://finance.yahoo.com/q/op?s=BJS&m=2008-05";
   echo file_get_contents($url);
?>

 

so sumfin else is going on with yer setup, or the coding u use to generate the url

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.