HTML中的PHP代码

here $check variable is from php code..which is bolean... Actually if users put correct username and password this variables becomes true.. if this variable is true then i want replace the "Login" with "My account".. how can i do that? any help would be appreciated. Thanks.

if ($check) {
  <a href="myaccount.php" class="almanac">
    <svg viewBox="0 0 100 25" class="shape-tab">
      <use xlink:href="#shape-tab"></use>
    </svg>
    <span>My Account</span>
  </a>
} else {
  <a href="login.php" class="almanac">
    <svg viewBox="0 0 100 25" class="shape-tab">
      <use xlink:href="#shape-tab"></use>
    </svg>
    <span>Login</span>
  </a>
}

But problem is that $check is defined in php code.

You need to distinct the PHP and the HTML parts. This should do the trick:

  <?php if ($check) { ?>
  <a href="myaccount.php" class="almanac">
  <svg viewBox="0 0 100 25" class="shape-tab">
  <use xlink:href="#shape-tab"></use>
  </svg>
  <span>My Account</span>
  </a>
  <?php } else{ ?>
  <a href="login.php" class="almanac">
  <svg viewBox="0 0 100 25" class="shape-tab">
  <use xlink:href="#shape-tab"></use>
  </svg>
  <span>Login</span>
  </a>
  <?php } ?>