can you sort both files first? and then compare? You can move through the file without loading the whole file, you can read the file in chunks
http://au.php.net/manual/en/function.fread.php
Comparing 2 large CSV files with PHP
Moderator: General Moderators