&#39; href =&#39;的含义<! - ? =变量? - >&#39;在HTML / PHP网页上

时间:2016-09-04 16:02:32

标签: php html

我觉得在解释时我会感到愚蠢,但有人能告诉我以下陈述的作用吗?

href='<?= $authUrl ?>'

它取自以下Google API身份验证登录代码。

<div class="box">
  <?php if (isset($authUrl)): ?>
  <div class="request">
    <a class='login' href='<?= $authUrl ?>'>Connect Me!</a>
  </div>
  <?php elseif($_SERVER['REQUEST_METHOD'] == 'POST'): ?>
  <div class="shortened">
    <p>Your call was successful! Check your drive for the following files:     </p>
  </div>
  <?php else: ?>
  <form method="POST">
    <input type="submit" value="Click here to list your tables" />
   </form>
 <?php endif ?>
</div>

1 个答案:

答案 0 :(得分:1)

Php有一个简写版本的echo

<?php 
    $foo = "bar";
?>
<a href="<?= $foo ?>">I'm linking to bar </a>