How can I exclude admin(uid=1) for "Views Argument PHP Validator code" which limit a view to a User’s uid value? I have a page view with a menu tab and URL looks like  my-site.com/user/%/my-view

I use return $argument == $GLOBALS['user']-&gt;uid; for default argument.
And then I would like to limit the argument to only the currently logged-in user’s uid but how can I exclude admin role (uid=1)?

After reading this article I tried this but didn't work.

global $user; 
if($user-&gt;uid != 1){
return $argument == $GLOBALS['user']-&gt;uid;
}


What I need to achieve is:
Admin role(uid=1) can see my-site.com/user/%/my-view for all users but the rest of the users can see only the view according to their uid.
That is a basic PHP problem, it does not concern Drupal so much. You want to admit access to the admin user always, so you will want to exclude that user's user id of any checks. However, your logic is wrong. The correct version would be

global $user;
return ($user-&gt;uid == 1 || $user-&gt;uid == $argument);


Which firstly returns true if the user is the admin user and secondly returns true if the user id matches the argument.