欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  php教程

php 文件操作

程序员文章站 2024-01-25 12:55:34
...
print?ini_set('memory_limit', '-1'); //
ini_set("max_execution_time", "3600"); //设置超时时间

$filep='qq.txt';


$str=file('qq.txt');
$lineCount = 0;
foreach( $str AS $line ) {
$line = str_replace( "\t", " ", $line );
$tr = trim( $line );
if ( preg_match( "/\\*|^\*|^ {1,}\*|\/\*|\*\/|^ {1,}\/\/|^\/\//", $line ) || $tr === "" ) {
continue;
}
$lineCount++;

$line = str_replace( "\r", "", $line );
$line = str_replace( "\n", "", $line );
if($lineCount is_m('5.txt',"".$line."@qq.com\n");
continue;
}elseif ($lineCount is_m('10.txt',"".$line."@qq.com\n");
break;
}


}



function is_m($filename,$c){
$handle = fopen($filename, "a");
if ($handle) {
fwrite($handle, $c );
fclose($handle);
} }