Posted By

nicolaspar on 11/02/07


Tagged

php link href generar


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

luman
arcturus
vali29
willcodeforfood


Php - Agregar href en textos


 / Published in: PHP
 

Genera links en base a http, www, ftp

  1. function ponerLinks( $str ){
  2. $tmp = eregi_replace('((ftp|http|www)[-a-zA-Z0-9@:%_\+.~#?&//=]+)', '<a href="\\1" target="_blank">\\1</a>', $str);
  3. return str_replace('href="www.','href="http://www.', $tmp);
  4. }

Report this snippet  

You need to login to post a comment.