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 ?>

 

posted @ 2014-08-13 01:19  韵脚学员  阅读(517)  评论(0编辑  收藏  举报