所以我有这个
echo "<a class='btn btn-primary' href=''>Read more...</a>";
在PHP循环中,我想做这样的事情:
<a class='btn btn-primary' href=“single.php?news=<?php echo “$row[‘codn’] ?>”>Read more...</a>
我如何轻松地做到这一点?
答案 0 :(得分:2)
只需结合如下
echo "<a class='btn btn-primary' href='single.php?news=".$row['codn']."'>Read more...</a>";
答案 1 :(得分:1)
将此内容放入循环中
echo "<a class='btn btn-primary' href='single.php?news=" . $row['codn']. "'>Read more...</a>";