hi,
i wanna extract emails from a query result and make them active.
the replace doesn't work - i think the error is in the regex...
would be very apprecheated for help.
if (ereg("[\w-]+(.[\w-])@\w+(.\w+)(.[a-z]{2,4})", mysql_result($result, $i, "Text"), $match)) {
$repl = ereg_replace($match[0], "<a href=mailto:$match[1]$match[2]$match[3]> $match[0] </a>" , "<p><font face='Arial' size='2' color='#000000'>" . nl2br(htmlentities(stripslashes(mysql_result($result, $i, "Text")))) . "</font></p>");
print "$repl";
} else {
print "<p><font face='Arial' size='2' color='#000000'>" . nl2br(htmlentities(stripslashes(mysql_result($result, $i, "Text")))) . "</font></p>";
}
many thanx
kristijan