note 71146 deleted from function.preg-replace by colder

From: Date: Mon, 18 Jun 2007 20:05:38 +0000
Subject: note 71146 deleted from function.preg-replace by colder
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-127708@lists.php.net to get a copy of this message
Note Submitter: v0lk ---- I've made this from script, presented below: <?php $text = preg_replace('=([^\s]*)(www\.)=', ' http://www.', $text); $text = preg_replace('=([^\s]*)(\w://[www\.]*)([^\s]*)=', '<a href="\\1\\2\\3\\4" target=_blank>\\3\\4</a>', $text); ?> dunno how it works, but it works But if link is long, then I'd like the part ">...</a>" to become shorter - till the end of file name (till "?") guess

« previous php.notes (#127708) next »