你调用的是它的方法就是null_write()这个方法是把$new内容写进$file里面
http://www.phpe.net/articles/18.shtml

解决方案 »

  1.   

    <?
    class  xx  {  
     
               var  $file;          
      function  null_write($new)  
               {  
                           $f=fopen($this->file,"w");          
                           flock($f,LOCK_EX);  
                           fputs($f,$new);          
                           fclose($f);    
               }   
    }$dd=new xx($file);
    $dd->file="c://oa/apache/htdocs/1.txt";
    $new="dsa";
    $dd->null_write($new) ; 
    ?>