Este código sirve para ver como se hace if y else en php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<?php
$Mensaje = 1;
if($Mensaje>0){
echo"Tienes $Mensaje";
}else{
echo 'no tienes mensaje';
}
?>
</body>
</html>