Posted: Sat Dec 27, 2003 12:46 pm
example:
[php]<?php
function auto_link($text) {
RETURN eregi_replace("(http://([a-zA-z0-9_-]+[\.]{1})*[\.]{0,1}[a-z]{2,3})","<a href=\"\\1\" target=\"_BLANK\">\\1</a>",$text);
}
echo auto_link("blablabla normal text, but this is a hyperlink: http://forums.aq2world.net");
?>
[/php]
The rest u can do urself basic php
Just put the function on top of ur source.
Then after u get the data from the db, do the auto_link.
or before u add the data to ur db
---
Some help:
http://nl.php.net/manual/en/function.eregi-replace.php
[php]<?php
function auto_link($text) {
RETURN eregi_replace("(http://([a-zA-z0-9_-]+[\.]{1})*[\.]{0,1}[a-z]{2,3})","<a href=\"\\1\" target=\"_BLANK\">\\1</a>",$text);
}
echo auto_link("blablabla normal text, but this is a hyperlink: http://forums.aq2world.net");
?>
[/php]
The rest u can do urself basic php
Just put the function on top of ur source.
Then after u get the data from the db, do the auto_link.
or before u add the data to ur db
---
Some help:
http://nl.php.net/manual/en/function.eregi-replace.php