Hmmm, I'm guessing fgets includes the newline with the string, in which case you can either change that single line to this:
PHP code:
$lines[] = trim(fgets($user_file, 4096);)
Or replace the whole while loop with this:
PHP code:
$lines = preg_split( '\r?\n' , trim(fread($user_file , filesize($user_file))) );
EDITED: 17 Jul 2012 17:58 by BOUGHTONP