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">