php修改指定文件的指定内容

1 <?php
2 $origin_str = file_get_contents('路径/文件.txt');
3 $update_str = str_replace('qwe=0', 'qwe=1', $orgin_str);
4 file_put_contents('路径/文件.txt', $update_str);
5 ?>
原文地址:https://www.cnblogs.com/mrcln/p/3909064.html