PHP 8.5.0 Alpha 1 available for testing

Voting

: max(eight, four)?
(Example: nine)

The Note You're Voting On

Eric Pecoraro
20 years ago
<?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';
}
}

?>

<< Back to user notes page

To Top