我觉得在解释时我会感到愚蠢,但有人能告诉我以下陈述的作用吗?
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>
答案 0 :(得分:1)
Php有一个简写版本的echo
<?php
$foo = "bar";
?>
<a href="<?= $foo ?>">I'm linking to bar </a>