adv Posted November 23, 2011 Share Posted November 23, 2011 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 More sharing options...
adv Posted November 23, 2011 Author Share Posted November 23, 2011 anybody plzz Link to comment https://forums.phpfreaks.com/topic/251674-search-in-files/#findComment-1290742 Share on other sites More sharing options...
PFMaBiSmAd Posted November 23, 2011 Share Posted November 23, 2011 array_diff Link to comment https://forums.phpfreaks.com/topic/251674-search-in-files/#findComment-1290743 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.