du16178 2019-05-27 17:37
浏览 154

如何在PHP中的此文本字符串中获取可点击链接[复制]

This question already has an answer here:

I have tried to send an email from PHP with the next body:

$message .= 'This is a simple message';
$message .= "
";
$message .= 'http://www.yahoo.com';
$message .= "
";
$message .= "<a href='https://www.google.com'>Google</a>";
$message .= "
";

As a result I got the next output:

This is a simple message    //This line is ok
http://www.yahoo.com        //This line is ok
<a href='https://www.google.com'>Google</a> //It should appear the word Google clickable but it does not

Instead of having the word Google with the link clickable to the Google site I get the html code, how could I fix this? Thanks

</div>
  • 写回答

2条回答 默认 最新

  • dth62818 2019-05-27 17:43
    关注

    I'm not sure, haven't tried it but maybe try:

    $message .= '<a href="https://www.google.com">Google</a>';
    

    NOTE: added double quotes in href link

    评论

报告相同问题?

悬赏问题

  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿