开发者

PHP file input, accessing the content of the file

开发者 https://www.devze.com 2023-01-24 16:56 出处:网络
I am making a file input that takes in a txt file.How do I 开发者_Python百科access the contents of the file that just got uploaded using PHP?$contents = file_get_contents(\'/path/to/file\');

I am making a file input that takes in a txt file. How do I 开发者_Python百科access the contents of the file that just got uploaded using PHP?


$contents = file_get_contents('/path/to/file');


If you want to access the file directly:

$content = file_get_contents($_FILES["file_input_field_name"]["tmp_name"]);

If you want to store the file, you'll want to check out:

http://php.net/move_uploaded_file

0

精彩评论

暂无评论...
验证码 换一张
取 消