gpt4 book ai didi

php - 如何制作位于另一台服务器中的文本文件的副本

转载 作者:行者123 更新时间:2023-12-04 06:16:13 24 4
gpt4 key购买 nike

如何在 php 中制作位于另一台服务器中的文本文件的副本

最佳答案

我可以立即想到两种方法:

file_put_contents('/my/path/file.txt', file_get_contents('http://www.example.org/test.txt'));

file_get_contents() file_put_contents() 手册页。

或者更简洁:
copy('http://www.example.org/test.txt', '/my/path/file.txt')

copy() manual page .

当然不要忘记:

A URL can be used as a filename with this function if the fopen wrappers have been enabled.



allow_url_fopen manual page想要查询更多的信息。

关于php - 如何制作位于另一台服务器中的文本文件的副本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7206915/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com