php在文件指定行中写入代码的方法

上传:pisming52875 浏览: 27 推荐: 0 文件:PDF 大小:30.16KB 上传时间:2020-12-23 04:10:04 版权申诉
复制代码 代码如下: <?php $file=”aa.php” ; $code=”[removed][removed]”; $f=fopen($file,”r+”); $content=fread($f,filesize($file)); fclose($f); if(!strstr($content,$code)){ $arrInsert = insertContent($file, $code, 3); unlink($file); foreach($arrInsert as $value) { file_put_contents($f
上传资源
用户评论