PHP变量如HTML中的href


PHP Variable as href in HTML

我需要使用PHP变量打开链接。

我试着在网上搜索解决方案,但是没有解决方案可以解决我的问题。

这是我的代码。当我点击链接时,什么也没发生。

p/s:链接在本地主机之外。

echo '<tr><td colspan ="3"><a href="'.$webPath.'"target="_blank">'.$webPath.'</a></td></tr>';

Php没有服务器是不能工作的。

您必须在localhost或live server中检查

如果是你电脑上的文件,链接应该以…

file:///path/to/location

希望能成功