there's a much easier way to get rid of whitespace and linebreaks at the end of a variable than using a looped ereg_replace (as i previously suggested) 1) use trim() 2) use preg_replace('/\s*$/', '', $input) both will cremate spaces and linebreaks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]