I want to use file_get_contents to read a url, but it can't read the second arg because it seems to stop at the ampersand.
I want to use file_get_contents to read a url, but it can't read the second arg because it seems to stop at the ampersand.
why not mask the orignal URL with one from tinyurl.com
it will make the string shorter but also remove any unwanted ampersands. The URL will still load. Try it and see...
Regards,
Zenax
First not sure why you are using that method to gey the adress of a url, but the answer to your problem is:
Code:$url = htmlspecialchars( $url );
Answer to your question...
& escapes as %26
Last edited by shaunak; 04-17-2008 at 01:36 AM.
Cheers,
Shaunak
&'s character code is & in HTML