I'd like a function that checks whether an array's items contain a string. As such:
array(1 => 'Super-user', 'Root', 'Admin', 'Administrator', 'System', 'Website', 'Owner', 'Manager', 'Founder');
And then checking for admin12 should return true as a part of admin12 (admin) is also a part of the array.
I came this far:
$forbiddennames= array(1 => 'Super-user', 'Root', 'Admin', 'Administrator', 'System', 'Website', 'Owner', 'Manager', 'Founder');
if(in_array( strtolower($stringtocheck), array_map('strtolower', $forbiddennames))){
echo '"This is a forbidden username."';
} else {
echo 'true';
}
}
Only this only echos "This is a forbidden username." when I check for admin. I want it also to echo when checking for admin12.
Is this possible (and how)?