Re: User Passwords: checking for unique chars

From: Date: Mon, 14 Feb 2005 17:41:00 +0000
Subject: Re: User Passwords: checking for unique chars
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-208660@lists.php.net to get a copy of this message
Alex Gemmell wrote: > I'm checking user chosen passwords for validity and have created 7 > tests. It's not 100% bulletproof but it will do for now. My problem > is with the last check "have 6 unique characters". I'm at a loss at > how to check for this in a neat one-liner. if (count(count_chars($password, 1)) < 6) return false; http://php.net/count_chars No regex at all :-) -- Like Music? http://l-i-e.com/artists.htm

« previous php.general (#208660) next »