It works perfectly on localhost with Xampp, but when I try it on my server (host-ed.net), fopen can\'t open any url, it only works for files without http.
The permission for opening urls with fopen is controlled by the php.ini setting allow_url_fopen. You can see your current setting using phpinfo() which will dump an html doc containing all your server settings.