Codice PHP:$min = 1;
$max = 3;
$in_uname = "pip";
$in_uname2 = "pippo6";
$pattern = "/[[:alnum:] _-]{{$min},{$max}}/i";
preg_match($pattern, $in_uname, $match);
preg_match($pattern, $in_uname2, $match2);
if (isset($match[0]) and $match[0] !== ""){
echo "Primo match
";
} else {
echo "Primo NO match
";
}
if (isset($match2[0]) and $match2[0] !== ""){
echo "Secondo match
";
} else {
echo "Secondo NO match
";
}
![]()
![]()

Rispondi quotando