How to add array [closed]

You don’t need array to do this. The following code will be worked. You have to just add other username also inside if condition with or operation.

if ('plugins.php' === $pagenow ||'update-core.php' === $pagenow ) {   
   // wp_safe_redirect( home_url() ); 
 // Now check the current user
$user = wp_get_current_user();
if ( $user->user_login == 'Remo' || $user->user_login == 'Sam') {
    wp_safe_redirect( admin_url() );
    exit();
}

If you want to use array you can add users to array and then you can use in_array function to check it.

if ('plugins.php' === $pagenow ||'update-core.php' === $pagenow ) {   
   // wp_safe_redirect( home_url() ); 
 // Now check the current user
$user = wp_get_current_user();
$users = array("Remo", "Sam");

if ( in_array($user->user_login, $users)) {
    wp_safe_redirect( admin_url() );
    exit();
}

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)