问题
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