Drupal Get User ID

In Drupal the logged in user is stored as a global variable. Following code can access the logged in user ID

And in profile page, you can use $user variable directly