I'm trying to ignore uppercase or lowercase with the code below to detect whether the user is blocked or not. Is working when matching the username or email but with the case problem, the validation does not work. How to make it case insensitive? Thanks for helping.
$msg = "something";
$blocked = preg_split('/[\r\n]([a-z])([A-Z])+/', admin_get_option('blocked_users'), -1, PREG_SPLIT_NO_EMPTY);
if ( isset($form['username_or_email']) && in_array( $form['username_or_email'], $blocked) ) {
$errors['username_or_email'] = $msg;
}
if ( isset($form['user_login']) && in_array( $form['user_login'], $blocked) ) {
$errors['user_login'] = $msg;
}
if ( isset($form['user_email']) && in_array( $form['user_email'], $blocked) ) {
$errors['user_email'] = $msg;
}