找个论坛看看不就知道了吗?
到baidu.com搜索“php ubb代码”

解决方案 »

  1.   

    贴子内容<a href="连接地址">连接名称</a>贴子内容,显示贴子时直接输出即可。
      

  2.   

    用正则匹配preg_replace("/(?<=[^\]a-z0-9-=\"'\\/])((https?|ftp|gopher|news|telnet|mms|rtsp):\/\/|www\.)([a-z0-9\/\-_+=.~!%@?#%&;:$\\()|]+)/i","<a href=\"\\1://\\2\" target=\"_blank\">\\1://\\2</a>",$url);
      

  3.   

    贴错了,用这个$url = "http://www.cctv.com.cn";
    $url=preg_replace("/((https?|ftp|gopher|news|telnet|mms|rtsp):\/\/|www\.)([a-z0-9\/\-_+=.~!%@?#%&;:$\\()|]+)/i","<a href=\"\\1\\3\" target=\"_blank\">\\1\\3</a>",$url);
    echo $url;