So, I have two files In the first file, there is text:hash
In the other file there is hash:pass
I wrote some code to match the hash and then print the text (So when ran, I'd get an output of text:pass) It works fine and it finds all the information, however sometimes it will skip certain ones and just not find anything. (If I go and do it by hand the data is there) So I'm not sure why it will find most of them but not all. Anyway I'm hoping someone can help, the code is below:
<?php
$emailhash = file('emailhash.txt');
$hashpass = file('hashpass.txt');
$list = '';
foreach($emailhash as $data) {
$data = str_replace("\r\n",'', $data);
$array_emailhash = explode(":", $data);
$email = $array_emailhash[0];
$hash = $array_emailhash[1];
foreach($hashpass as $data2) {
$data2 = str_replace("\r\n",'', $data2);
$array_hashpass = explode(":", $data2);
$hash2 = $array_hashpass[0];
$pass = $array_hashpass[1];
if($hash2 == $hash)
$list .= $email.':'.$pass."\r\n";
}
}
file_put_contents('emailpass.txt', $list);