Home > Backend Development > PHP Tutorial > 微信公众号开发如何回复正确的超链接?

微信公众号开发如何回复正确的超链接?

WBOY
Release: 2016-06-06 20:27:32
Original
1359 people have browsed it

微信公众号在开发时想发送一个超链接给用户,类似百度,点击直接到百度页面
可以这样写

<code>$content = '<a href="http://www.baidu.com">百度</a>';</code>
Copy after login
Copy after login

因为我自己的链接可能有变量,所以我就采取如下做法:

<code>$url = "http://www.baidu.com?id=".$id;
$content = '<a href=".%24url.">百度</a>';
</code>
Copy after login
Copy after login

如何就得不到正确的结果了,只回复了一个链接

<code> http://www.baidu.com?id=xxx
</code>
Copy after login
Copy after login

请问我该如何才能得到想要的效果呢?

回复内容:

微信公众号在开发时想发送一个超链接给用户,类似百度,点击直接到百度页面
可以这样写

<code>$content = '<a href="http://www.baidu.com">百度</a>';</code>
Copy after login
Copy after login

因为我自己的链接可能有变量,所以我就采取如下做法:

<code>$url = "http://www.baidu.com?id=".$id;
$content = '<a href=".%24url.">百度</a>';
</code>
Copy after login
Copy after login

如何就得不到正确的结果了,只回复了一个链接

<code> http://www.baidu.com?id=xxx
</code>
Copy after login
Copy after login

请问我该如何才能得到想要的效果呢?

<code>$content = '<a href="'.%24url.'">百度</a>';</code>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template