Hello i've writen a few scripts 2 or 3 years ago. Now it's not running. My scripts :
<?php
function tolink($text){
$text = " ".$text;
$text = ereg_replace('(((f|ht){1}tp://)[-a-zA-Z0-9@:%_\+.~#?&//=]+)',
'<a href="\\1" target="_blank" rel="nofollow">\\1</a>', $text);
$text = ereg_replace('(((f|ht){1}tps://)[-a-zA-Z0-9@:%_\+.~#?&//=]+)',
'<a href="\\1" target="_blank" rel="nofollow">\\1</a>', $text);
$text = ereg_replace('([[:space:]()[{}])(www.[-a-zA-Z0-9@:%_\+.~#?&//=]+)',
'\\1<a href="http://\\2" target="_blank" rel="nofollow">\\2</a>', $text);
$text = ereg_replace('([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,4})',
'<a href="mailto:\\1" rel="nofollow">\\1</a>', $text);
return $text;
}
?>
When i replace ereg_replace with preg_replace it gives me an error.
I need your help... Thank you...