forumnz Posted May 2, 2009 Share Posted May 2, 2009 I am going to write a script to upload a text file - my question is, how can I take the contents of that file and set it as a variable. For example, the file is a text file that reads "The quick brown fox jumps over the lazy dog". When the file dog.txt is submitted the script should take the file and set: <? $var = "The quick brown fox jumps over the lazy dog"; ?> This is probably a really dumb question but if you can help then thanks a lot! Sam Link to comment https://forums.phpfreaks.com/topic/156472-solved-quick-question-regarding-uploading-files/ Share on other sites More sharing options...
Ken2k7 Posted May 2, 2009 Share Posted May 2, 2009 Read file_get_contents() http://us2.php.net/manual/en/function.file-get-contents.php Link to comment https://forums.phpfreaks.com/topic/156472-solved-quick-question-regarding-uploading-files/#findComment-823932 Share on other sites More sharing options...
forumnz Posted May 2, 2009 Author Share Posted May 2, 2009 Thanks Ken2k7! Sam Link to comment https://forums.phpfreaks.com/topic/156472-solved-quick-question-regarding-uploading-files/#findComment-823943 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.