Jump to content

search in files


adv

Recommended Posts

hello

my problem is this

I`m trying to search in two different files.

 

<?php 
$file=file($argv[1]);   /// old users
$file1=file($argv[2]);  //// new users 
$err=0;
foreach($file as $files){  
$split=explode("\n",$files);  
	for($i=0;$i<count($file1);$i++) {   
  		if($split[0]==$file1[$i]){
  			$err=1;
  		}else{
  			$save=$file1[$i].chr(10);
  			$fp=fopen('aa',"a+");
  			fputs($fp,$save);
  			fclose($fp);
  		}
  	}	    
        } 
?>

 

that that i tried above it doesnt save good

my purpose is to read the old users and the new ones and in the new ones there are old ones and what i want to do is to extract the old ones  and replace it it  ' '  in the newones file

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.