Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "Look on http://www.google.com".
- $string = "Look on http://www.google.com"
- $new_string = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]","<a href="\0">\0</a>", $string);
- $text = preg_replace('@(https?://([-w.]+)+(:d+)?(/([w/_.]*(?S+)?)?)?)@', '<a href="$1">$1</a>', $text);
- <?php
- // The Regular Expression filter
- $pattern = "/(http|https|ftp|ftps)://[a-zA-Z0-9-.]+.[a-zA-Z]{2,3}(/S*)?/";
- //example text
- $text="Example user text with a URL http://www.zero7web.com , second link http://www.didsburydesign.co.uk";
- // convert URLs into Links
- $text= preg_replace($pattern, "<a href="\0" rel="nofollow">\0</a>", $text);
- echo $text;
- ?>
- $result = preg_replace('/b(https?|ftp|file)://[-A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|]/i', '<a href="