Many free web hosts set allow_url_fopen to off and that's why I can't use fopen. I just want to know if there is a way I can open a file, specifically a text file (*.txt), via an external url.
if you have a .txt file on same server then use fopen function, you can see details at php.net/fopen or use this line in your .htaccess file php_value allow_url_fopen 1 you can consider using curl, if it is enabled.