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?

Link to comment
Share on other sites

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.

 

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.