<?php
// Require (n) unique characters in a string
// Modification of a function below which ads some flexibility in how many unique characters are required in a given string.
$pass = '123456' ; // true
$pass = '111222' ; // false
req_unique($pass,3);
function req_unique($string,$unique=3) {
if ( count(count_chars($string,1)) < $unique) {
echo 'false';
}else{
echo 'true';
}
}
?>