【发布时间】:2016-01-22 12:40:34
【问题描述】:
我有一个字符串和一个链接,如下:
$link = 'https://www.google.co.in';
$str = 'Hi all welcome to the google page Google Page';
现在我想让'Google Page'这个词成为一个超链接。当整个字符串 ($str) 将出现在网页上时,字符串 'Google Page' 应显示为超链接,单击它时链接 'https://www.google.co.in' 应打开。
为了实现这一点,我尝试了以下代码但没有成功。
Phpfox::getUserBy('full_name').' accepted your request to join'.<a href=$sLink>Google Page</a>Group Name
echo 'Hi all welcome to the google page <a href=$link> '.Google Page'.'</a>'';
有人可以帮助我并纠正我在代码中所犯的错误吗?
谢谢。
【问题讨论】:
标签: php string hyperlink anchor string-concatenation