I'm trying to clean my db
if($var == true){
$db = file('db.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
shuffle($db);
$db2 = file('db2.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
$cleaner = array_unique ($db);
$final = array_diff ($cleaner, $db2);
file_put_contents('db3.txt', $final);
}
it should put in db3.txt all users with a newline like:
Mike\nRobert\nJhon\nPolly
but it return all users attached between them