Adjunto la funcion que utilizo para que alguien me ayude por favor! gracias :D
Código PHP:
Ver original
function texto_a_url($text) { $ret = ' ' . $text; '#([\t\r\n ])([a-z0-9]+?){1}://([\w\-]+\.([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^ \"\n\r\t<]*)?\.(png|jpg|jpeg))#i', '#([\t\r\n ])([a-z0-9]+?){1}://([\w\-]+\.([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^ \"\n\r\t<]*)?)#i'); '<div class="videos" id="'.rand().'"><iframe width="560" height="315" src="http://www.youtube.com/embed/$2" frameborder="0" allowfullscreen></iframe></div>', '\1 <div class="imagenes_links" imagen="\2://\3" ><img src="\2://\3" id="la_imagen_todo"/></div>', '\1<a href="\2://\3" target="_blank">\2://\3</a>'); '\1<a href="http://\2.\3" target="_blank">\2.\3</a>', $ret); "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $ret); return ($ret); }