[英]How to update a single line of a .txt file and delete a line using the username in php [on hold]
我正在尝试更新一些信息的数据并通过搜索确定的用户名删除一个。 我该怎么做?
您应该使用适当的路径将文件与下面的 php function 一起读取到数组中。
file_get_contents()
然后尝试更改该数组中需要更新的信息。 之后用该数组更新文件。 您可以使用
file_put_contents()
这是有关这些功能的详细信息的链接。
https://www.php.net/manual/en/function.file-get-contents.php
https://www.php.net/manual/en/function.file-put-contents.php
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.