您可以使用file_put_contents。
<?php
file_put_contents("/home/public_html/files/hi.txt", "content");
?>
Run Code Online (Sandbox Code Playgroud)
或者,如果您不需要内容并且只想确保文件已创建,请触摸:
<?php
touch("/home/public_html/files/hi.txt");
?>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6041 次 |
| 最近记录: |