gesf
New member
You need some REGEX for that. Here you have a great function to make it for you:
Example:
Code:
<?php
// -------------------------------------------------------------------
// Auto make a link from a string
// -------------------------------------------------------------------
function AutoLink($input){
$output = eregi_replace("(http|https|ftp)://([a-z0-9\-\./]+))","<a href=\"\\0\">\\0</a>", $input);
$output = eregi_replace("(([a-z0-9\-\.]+)@([a-z0-9\-\.]+)\.([a-z0-9]+))","<a href=\"mailto:\\0\">\\0</a>", $output);
return $output;
}
?>
Code:
<?php
print AutoLink($_POST['message']);
?>