簡體   English   中英

如何使用 php 中的用戶名更新 a.txt 文件的單行並刪除一行 [暫停]

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM