php - Get text from URL txt -
is there way simple php code displays text txt document, that's on url?
this i've got far. i'm sure i'm missing something~
<? $text = file_get_contents('https://dl.dropboxusercontent.com/u/28653637/snip/snip/snip.txt'); fopen ($text) ?>
guessing can't open it, since it's not on drive. workaround that, or fix guys me with?
thanks (:
too easy! :)
$text = file_get_contents('https://dl.dropboxusercontent.com/u/28653637/snip/snip/snip.txt'); echo $text;
explanation:
file_get_contents()
return contents of remote file , assign $text
variable. you'll have ouput these contents using echo
statement
alternative: use readfile()
function. output contents of file directly:
readfile('https://dl.dropboxusercontent.com/u/28653637/snip/snip/snip.txt');
Comments
Post a Comment