首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > PHP >

php 资料操作

2013-04-02 
php 文件操作ini_set(memory_limit, -1)//ini_set(max_execution_time, 3600) //设置超时时间$f

php 文件操作

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<5){        is_m('5.txt',"".$line."@qq.com\n");        continue;       }elseif ($lineCount <10){         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);        } }

热点排行