【发布时间】:2021-10-20 10:46:39
【问题描述】:
我是 php 新手,所以这可能是一个乏味的问题,但我正在尝试在我的 php 代码中插入一个 href 链接。我看到了如何做到这一点,但我不确定如何使用 echo 以便我可以在它之前和之后有文本。我尝试使用连接符号 (.),但出现编译错误。我希望链接在一些文字之后出现。这个链接后面也会有文字。这是我目前拥有的:
Session::flash('demo', "You're using a demo account - the changes that you make will not be stored. Learn more ".echo" <a href=$learnMore> here </a>");
感觉很不对劲,但我不知道如何解决,因为这是我第一次用这种语言写作。有什么建议吗?非常感谢:)
【问题讨论】:
-
不确定您使用的是哪个框架,但我很确定它应该更像:
Session::flash('demo', "You're using a demo account - the changes that you make will not be stored. Learn more <a href='".$learnMore."'> here </a>"); -
谢谢!那行得通。