Jump to content

[SOLVED] file_get_contents and characters in a URL problem


bigtimslim

Recommended Posts

I use the file_get_contents function to get the html from a page. I parse through that page and get a specific url I want. It looks similar to this:

 

http://www.domain.com/index.cfm?action=blah&ID=5000

 

Now I want to file_get_contents the above url. I understand that the & is for html so I tried to convert the string to work as a url. I tryed both using urlencode function on the query of this url and just manually through php replacing with what I thought were the appropriate characters with no luck. Can anyone help, or point me in the right direction?

Thanks very much guys for the quick replies. Caesar I thought tried that same exact thing last night... then I said what the heck and tried your code and of course it worked.  ;D I must have been doing something stupid.

 

Thanks for the link discomatt that is exactly what I needed.

 

 

 

 

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.