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
https://forums.phpfreaks.com/topic/251674-search-in-files/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.