Home > Article > Backend Development > WeChat Public Account Development Tutorial Part 8 - Using Web Page Hyperlinks in Text Messages_PHP Tutorial
This article mainly introduces the role of web hyperlinks and how to use web hyperlinks in text messages.
The role of web hyperlinks
I think anyone who is familiar with HTML will be familiar with hyperlinks. Today we are going to discuss and use only one type of hyperlink - web page hyperlink, which uses the 3499910bf9dac5ae3c52d5ede7383485 tag in HTML to link a certain text to other web pages. The example is as follows:
<a href="http://blog.csdn.net/lyq8479">柳峰的博客</a>The above is a standard HTML code that implements a web page hyperlink, that is, the 5 words "Liu Feng's Blog" are linked to the blog homepage URL. When the 5 words "Liu Feng's Blog" are used, http://blog will be opened. The web page pointed to by .csdn.net/lyq8479.
How to use web hyperlinks in text messages
In fact, almost 100% of developers who don’t know how to use web hyperlinks in text messages are familiar with HTML, especially the 3499910bf9dac5ae3c52d5ede7383485 tag in HTML. So what’s so special about using hyperlinks in text messages on WeChat public accounts? Why do so many friends have stumbled upon this issue? Let’s first look at two ways to incorrectly use hyperlinks in WeChat:
Incorrect usage 1 (the href attribute value of the a tag is not quoted):
<a href=http://blog.csdn.net/lyq8479>柳峰的博客</a>Wrong usage 2 (the href attribute value of the a tag is enclosed in single quotes>
<a href='http://blog.csdn.net/lyq8479'>柳峰的博客</a>
Effect on Android phone:
The effect on iPhone:
It can be seen that on WeChat, the value of the HTML a tag attribute is not enclosed in quotation marks, or is enclosed in single quotation marks, which is an incorrect way of writing (on the iPhone, it is normal for the value of the a tag attribute href to be enclosed in single quotation marks) . The correct usage is to enclose the value of the href attribute of the a tag in double quotes. The code is as follows:
<a href="http://blog.csdn.net/lyq8479">柳峰的博客</a>
Tip: When testing WeChat public accounts, don’t think it’s completely fine just because the test passes on your own phone, because there are currently several places on WeChat public accounts that behave inconsistently on Android and iOS platforms.
If you think the article is helpful to you, please leave a message or follow the WeChat public account xiaoqrobot to support Liu Feng!