| Welcome to WebmasterWorld Guest from 220.127.116.11 |
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
|Pubcon Platinum Sponsor 2014|
|Problem with file get contents|
I'm experiencing a strange problem working with the file_get_contents function :
If I enter directly the URL, it's working fine :
$data = file_get_contents("http://www.domain.com/image.ashx?1234");
But, if I put the URL into a variable, it's not working anymore :
$url = "http://www.domain.com/image.ashx?1234";
$data = file_get_contents($url);
Thanks in advance for your help.
It works just the way it is.
Do you get an error?
Have you tried:
$data = file_get_contents(urlencode($url));
Perhaps the "?" is causing the problem.
Hope this helps,
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved