如何使用一个变量,它是一个URL,并将其传递给一个href标签,这样它就可以在HTML代码中打开一个超链接


How to Use a Variable which is a URL and pass it to a href tag so it opens as a Hyperlink in HTML code

var= www.google.com

现在我想把这个变量传递给一个href标签,我该怎么做呢?

我试着做下面,但它没有工作。我需要把它作为变量传递因为每次url都不一样。

<a href = " {{$var}} ">NoAbTerm</a>
谢谢你的帮助。

如果您希望变量为php,您可以这样做:

$whatevervariable = "http://www.google.com";
/* then, you can echo it out */
echo"
<a href='".$whatevervariable."'>google</a>
";
相关文章: