- array_intersect: documentation ( source)
<?php
global $user_login, $current_user;
$user_info = array(
'nothing',
'even more nothing'
);
$roles = array (
'administrator',
'subscriber',
);
if (array_intersect( $roles, $user_info)) {
echo 'success';
} else {
echo 'failure';
}
?>