string eregi_replace ( string $pattern , string $replacement , string $string )
<?php
$text = "This is a link to http://www.groad.net/ and http://www.qunet.info/ .";
echo ereg_replace("http://([a-zA-Z0-9./-]+)", "<a href=\"\\0\">\\0</a>", $text);
?>
This is a link to <a href="http://www.groad.net/">http://www.groad.net/</a> and <a href="http://www.qunet.info/">http://www.qunet.info/</a> .
<?php
$url = "groad (http://www.groad.net)";
$url = ereg_replace("http://([a-zA-Z0-9./-]+)([a-zA-Z/]+)", "<a href=\"\\0\">\\0</a>", $url);
echo $url;
?>
Remember ourdomain: http://www.groad.net/
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |