Home > Backend Development > PHP Tutorial > php file operation_PHP tutorial

php file operation_PHP tutorial

WBOY
Release: 2016-07-14 10:09:54
Original
1080 people have browsed it

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<5){ 
            is_m('5.txt',"".$line."@qq.comn"); 
             continue; 
           }elseif ($lineCount <10){ 
              is_m('10.txt',"".$line."@qq.comn"); 
                break; 
           } 
            
         
        } 
 
         
         
    function is_m($filename,$c){ 
         $handle = fopen($filename, "a"); 
         if ($handle) { 
         fwrite($handle, $c ); 
         fclose($handle); 
        } } 

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/477603.htmlTechArticleprint?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_...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template