[英]Display link as hyperlink enabled output from mysql in php page but I am getting error
If I execute this I am getting output properly: 如果执行此命令,则输出正确:
echo "<a href="'.$elink.'">'.$elink.'</a>";
but when I want to display my output in a table column format I am not able to insert: 但是当我想以表格列格式显示输出时,我无法插入:
echo "<td width='200'>" <a href="'.$elink.'">'.$elink.'</a> "</td>";
or
echo "<td width='200'>" "<a href="'.$elink.'">'.$elink.'</a>" "</td>";
or
echo "<td width='200'>" '<a href="'.$elink.'">'.$elink.'</a> "</td>";
请更正语法错误。
echo '<td width="200">' . '<a href="'.$elink.'">'.$elink.'</a></td>';
Looks like you have mismatched quotes. 看起来您的报价不匹配。 But I would use sprintf.
但是我会用sprintf。
echo sprintf("<td width='200'><a href='%1$s'>%1$s</a></td>", $elink);
First off you quotes are messed up. 首先,您的报价被弄乱了。 They should look like this:
它们应如下所示:
echo "<td width='200'> <a href='".$elink."'>".$elink."</a></td>";
Correct your string format 更正您的字符串格式
echo '<td width="200"><a href="'. $elink. '">' . $elink . '</a></td>';
I suggest you to use the attribute style ( style="width:200px;"
) instead the width attribute. 我建议您使用属性样式(
style="width:200px;"
)代替width属性。 Remember to Url Encode the parameters contained in the href attribute. 记住要对href属性中包含的参数进行Url编码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.