Find and replace in a file

前端 未结 4 559
醉话见心
醉话见心 2020-12-05 05:00

I want to replace certain strings with another one in a text file (ex: \\nH with ,H). Is there any way to that using PHP?

4条回答
  •  情歌与酒
    2020-12-05 05:31

    file_get_contents() then str_replace() and put back the modified string with file_put_contents() (pretty much what Josh said)

提交回复
热议问题