我想知道是否有人知道一个 PHP 函数,它可以接受一些纯文本,并将任何 URL 转换为链接,将任何图像 URL 转换为图像标签,并将任何视频 URL 转换为嵌入视频。
例如
www.mywebsite.com 是我网站的名称,这是徽标 www.mywebsite.com/logo.jpg 我在https://www.youtube.com/watch?v=loab4A_SqoQ有一个视频
会导致
<a href=“www.mywebsite.com”>www.mywebsite.com</a> is the name of my site and this is the logo <img src=“www.mywebsite.com/logo.jpg” /> I have a video at <iframe width="560" height="315" src="https://www.youtube.com/embed/loab4A_SqoQ" frameborder="0" allowfullscreen></iframe>