How can I check that there is a link in an article to automatically add tags?

Source: Internet
Author: User
How can I check that a link is automatically added to an article? At last, this post was edited by sky94132003 from 2014-09-2604: 10: 26 and thought that the existing resources on the Internet could not be used, as well as the difficult points... that is, the content may also need to filter the image and the video URL (iframe). I used the following section for automatic detection. if there is a link, it will automatically add & lt; a & gt; but how can I check that a link in an article will automatically add tags?

This post was last edited by sky94132003 at 04:10:26

I think it is impossible to use the existing resources on the Internet and the difficult points... that is, the content may also need to filter the image and video URL (iframe)

I used the following sections for automatic detection.

But the problem is that sometimes the image

The video is displayed in iframe mode.

So I would like to ask how I can take an Image () film () Filter such items (skip and ignore) </strong> <br/> The $ content obtained is already HTML code. <br/> <pre class = "brush: php "> <br/> $ content = preg_replace_callback ('#(? : Https? : // \ S +) | (? : Www. \ S +) | (? : \ S + \. \ S +) # ', function ($ arr) <br/>{< br/> if (strpos ($ arr [0], 'http ://')! = 0) <br/>{< br/> $ arr [0] = 'http ://'. $ arr [0]; <br/>}< br/> $ url = parse_url ($ arr [0]); <br/> // links <br/> return sprintf ('% 1 $ s', $ arr [0]); <br/> }, $ content); <br/> </pre> <br> ------ solution -------------------- <br> test: http://blog.baiwand.com /? Post = 150 <p class = "clear">

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.