微信公众平台开发文本消息嵌入超链接失败,求助
$contentStr = "\n\n回复<a href="http://www.baidu.com/">百度</a>或回复“搜索” 了解详情\n其他文字"; $resultStr = sprintf($textTpl, $fromUsername, $toUsername, time(), $msgType, $contentStr); /*$resultStr = "<xml> <ToUserName><![CDATA[".$fromUsername."]]></ToUserName> <FromUserName><![CDATA[".$toUsername."]]></FromUserName> <CreateTime>".time()."</CreateTime> <MsgType><![CDATA[text]]></MsgType> <Content><![CDATA[文本\n\n回复<a href="http://www.baidu.com/">需要嵌入超链接的文本</a>或回复“搜索” 了解详情\n其他文字]]></Content> </xml>";*/ echo $resultStr;
希望做过微信公众平台开发的指点下,网上说这么弄可以,但我的一直不成功,求解释
回复讨论(解决方案)
$contentStr = "\n\n回复<a href=\"http://www.baidu.com/\">百度</a>或回复“搜索” 了解详情\n其他文字";
$contentStr = "\n\n回复百度或回复“搜索” 了解详情\n其他文字";
难道这句话,你编辑器没有报错?
改成#1即可
或者
$contentStr = "\n\n回复百度或回复“搜索” 了解详情\n其他文字";
$contentStr = "\n\n回复<a href=\"http://www.baidu.com/\">百度</a>或回复“搜索” 了解详情\n其他文字";
$contentStr = "\n\n回复百度或回复“搜索” 了解详情\n其他文字";
难道这句话,你编辑器没有报错?
改成#1即可
或者
$contentStr = "\n\n回复百度或回复“搜索” 了解详情\n其他文字";
$contentStr = "\n\n回复<a href=\"http://www.baidu.com/\">百度</a>或回复“搜索” 了解详情\n其他文字";
转义
$contentStr = "\n\n回复百度或回复“搜索” 了解详情\n其他文字";
难道这句话,你编辑器没有报错?
改成#1即可
或者
$contentStr = "\n\n回复百度或回复“搜索” 了解详情\n其他文字";
是否是同一段代码?
$contentStr = "\n\n回复百度或回复“搜索” 了解详情\n其他文字";
难道这句话,你编辑器没有报错?
改成#1即可
或者
$contentStr = "\n\n回复百度或回复“搜索” 了解详情\n其他文字";
是否是同一段代码?
是的,文本消息的超链有时在安卓和IOS上不一样
$contentStr = "\n\n回复<a href=\"http://www.baidu.com/\">百度</a>或回复“搜索” 了解详情\n其他文字";
这是转义。。。。
基础知识,建议LZ好好学习一下基础知识。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

This AI-assisted programming tool has unearthed a large number of useful AI-assisted programming tools in this stage of rapid AI development. AI-assisted programming tools can improve development efficiency, improve code quality, and reduce bug rates. They are important assistants in the modern software development process. Today Dayao will share with you 4 AI-assisted programming tools (and all support C# language). I hope it will be helpful to everyone. https://github.com/YSGStudyHards/DotNetGuide1.GitHubCopilotGitHubCopilot is an AI coding assistant that helps you write code faster and with less effort, so you can focus more on problem solving and collaboration. Git

The combination of PHP and HTML is a common technology in web development. PHP can embed dynamic content in HTML files and implement auxiliary functions, which greatly improves the interactivity and customizability of the website. This article will introduce three techniques for embedding code and provide specific code examples for reference. 1. Use PHP tags to embed code. The most common way is to use PHP tags () to embed PHP code into HTML files to display dynamic content. For example, you can use PHP

With the advancement of communication technology, telephone contact has become more and more common in our daily lives. However, sometimes we may try to call a number only to find that the number is no longer reachable. In order to save time and energy, many people start looking for empty number verification services to confirm the validity of the number. This service can help users quickly check whether a number is valid and avoid unnecessary trouble. 1. What are the empty account detection platforms? Users can check the status of the number, including whether it is empty, by dialing the corresponding inquiry number or visiting the official website through the official inquiry service provided by the operator. This service is provided by many operators to facilitate users to quickly understand the usage of the number. Online empty number detection platforms are now emerging in an endless stream on the market. These platforms provide quick and convenient

When many of our friends use WPS to edit content, they sometimes add hyperlinks to specific text. Recently, some friends have reported that WPS hyperlinks cannot be opened and cannot be clicked to access after using many methods. About this How to solve the problem? In this software tutorial, the editor will share the specific solutions, hoping to help the majority of users. Solution to WPS hyperlink not opening: Method 1: Move the mouse over the hyperlink to see if it becomes clickable. 1. Open the software, click "File" in the upper left corner of the page, and select "Options" in the menu below. 2. After entering the new interface, click "Edit&rdq" on the left

Go language development mobile application tutorial As the mobile application market continues to boom, more and more developers are beginning to explore how to use Go language to develop mobile applications. As a simple and efficient programming language, Go language has also shown strong potential in mobile application development. This article will introduce in detail how to use Go language to develop mobile applications, and attach specific code examples to help readers get started quickly and start developing their own mobile applications. 1. Preparation Before starting, we need to prepare the development environment and tools. head

On March 3, 2022, less than a month after the birth of the world's first AI programmer Devin, the NLP team of Princeton University developed an open source AI programmer SWE-agent. It leverages the GPT-4 model to automatically resolve issues in GitHub repositories. SWE-agent's performance on the SWE-bench test set is similar to Devin, taking an average of 93 seconds and solving 12.29% of the problems. By interacting with a dedicated terminal, SWE-agent can open and search file contents, use automatic syntax checking, edit specific lines, and write and execute tests. (Note: The above content is a slight adjustment of the original content, but the key information in the original text is retained and does not exceed the specified word limit.) SWE-A

Where can I buy Optimism coins? Optimism Coin can be purchased on a number of cryptocurrency exchanges, including: Binance Huobi OKX Matcha Gate.io Kraken Bittrex Poloniex Coinbase Pro Gemini You will need to register an account with these exchanges and complete identity verification before you can purchase Optimism Coin. The steps to purchase Optimism coins are as follows: Choose a safe and reliable exchange. Register an account and complete identity verification. Fund your account. On the trading interface of the trading platform, find the trading pair of Optimism currency, such as OP/USDT. Enter the amount of Optimism coins you want to purchase and click

1. Open a PPT, or make a PPT that requires hyperlinks. 2. Select the content that needs to be inserted into a hyperlink. For example, we select the word "flower" and insert a hyperlink into it. 3. Click Insert in the menu bar, find the Hyperlink in the Link column, and click the hyperlink. 4. A window will appear, with the link on the left to select the location in this document, and then each slide in the PPT will appear. 5. You can select the slide you want to link, click once, and the preview mode of this slide will appear on the right. 6. With the hyperlink, the font color will change. We only need to click on the hyperlinked word when playing the slide, and the slide will automatically play to the slide we linked to.
