Ok I searched the board but I never found a place that had my question. The below code works just fine, but it will match both admonistrator and admANYAMOUNTOFCHARSnistrator. How would I set how many chars it would match? I would like to be able to set it to like 1 or 2 (depending on what the name is and how I would like it matched).
$user = "admonistrator";
$patterns = array(
"admin"=>"#adm(.*?)#si"
);
$replacements = array(
"admin"=>"(MATCHED)"
);
$check = preg_replace($patterns, $replacements, $user);
if(preg_match("(MATCHED)", $check)) {
echo "Username is disallowed.";
}
Thank You.
- Wraith.