php - 如何在 PHP 中的此文本字符串中获取可点击链接
问题描述
我试图从 PHP 发送一封带有下一个正文的电子邮件:
$message .= 'This is a simple message';
$message .= "\n";
$message .= 'http://www.yahoo.com';
$message .= "\n";
$message .= "<a href='https://www.google.com'>Google</a>";
$message .= "\n";
结果我得到了下一个输出:
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
我没有使用带有可点击到Google网站的链接的 Google一词,而是获得了 html 代码,我该如何解决这个问题?谢谢
解决方案
我不确定,没有尝试过,但也许可以尝试:
$message .= '<a href="https://www.google.com">Google</a>';
注意:在 href 链接中添加了双引号
推荐阅读
- sql - 错误:用作表达式的子查询返回多行 - POSTGRES
- python - PyQt5 - 多处理时重复的 GUI
- html - 如何使用@media 在我的网站顶部放置不同的横幅?
- java - 移动 iOS 中的 rsaEncryptionOAEPSHA1 和 rsaEncryptionOAEPSHA256 是否支持 MGF1 参数?
- python - 我的 setup.py 在 python 3.8.1 中安装所有依赖项有什么问题
- azure-powershell - 无法通过 Azure Powershell RunBook 将 Rest API 输出导出到 CSV
- ios - SwiftUI 将数据从 Firebase 加载到 TextView
- environment-variables - RHEL - 环境变量
- c# - 导入后错误操作 C# JSON 数据
- android - 将图像从图库上传到 Firebase 存储时应用程序崩溃