How to echo a hyperlink with a variable? [closed]

本秂侑毒 提交于 2019-12-13 05:42:34

问题


Getting these hyperlinks right and mixing HTML with PHP seems to be a constant source of sorrow for me. Whats wrong with this hyperlink?

echo '<a href = "googler.php?query='.$suggestion[$ss_count].'">$suggestion[$ss_count]</a><br>;

回答1:


it should be

echo '<a href = "googler.php?query='.$suggestion[$ss_count].'">'.$suggestion[$ss_count].'</a><br>';

Within single quotes variables are not interpolated so you have to pull the link text out of the string literal.




回答2:


try it ..!!

echo '<a href = "googler.php?query='.$suggestion[$ss_count].'">'.$suggestion[$ss_count].'</a><br>';



回答3:


you all missing the point.

JUST USE BACKSLASH



来源:https://stackoverflow.com/questions/17705248/how-to-echo-a-hyperlink-with-a-variable

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!