PHP文件读写

2015-02-11 0 527
PHP文件读写
    <?php  
    $handle  = @ fopen ( "demo.txt" ,  "r" );  
    if ( $handle ) {  
        while (( $buffer  =  fgets ( $handle ,  4096 )) !==  false ) {  
            echo  $buffer ;  
        }  
        if (! feof ( $handle )) {  
            echo  "Error: unexpected fgets() fail\n" ;  
        }  
        fclose ( $handle );  
    }  
      
    echo '<hr/>';  
      
    $length= readfile("demo.txt");  
      
    echo '<hr/>';  
      
    $file_str = 'demo.txt';  
      
    if(file_exists($file_str))  
    {  
        echo file_get_contents($file_str);  
          
    }  
      
    ?>  

遇见资源网 php PHP文件读写 http://www.ox520.com/7367.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务