if($user->isGuest()) { echo ''; }
if($user->isGuest()) { // Redirect to the login page header("Location: login.php"); exit; } else { // Display the page content echo 'In these examples, `$user` is likely an instance of a User class from a package library such as Symfony, Laravel, or Yii.Welcome, '.$user->getName().'!
'; // Other page content... }