有点呆,看不出两个输出的差别。咳咳...
$#@http://yubeinet.com/bbs
$#@<a href='http://yubeinet.com/bbs'>http://yubeinet.com/bbs</a>

解决方案 »

  1.   

    第一段我在WIN2K+IIS+PHP4.X测试只能输出
    $#@http://yubeinet.com/bbs
    第二段能输出
    $#@http://yubeinet.com/bbs
    $#@<a href='http://yubeinet.com/bbs'>http://yubeinet.com/bbs</a>
    我实在想不通为什么会这样~~~
      

  2.   


    要写作:
    $c=str_replace($c_match[0][$i],"<a href='".$c_match[1][$i]."'>".$c_match[1][$i]."</a>","$c");

    $c=str_replace("{$c_match[0][$i]}","<a href='{$c_match[1][$i]}'>{$c_match[1][$i]}</a>","$c");其实有一个高效的写法
    $c = "http://yubeinet.com/bbs";
    $c .= "http://yubeinet.com/bbs1";
    $c .= "http://yubeinet.com/bbs2";
    echo preg_replace("|\[url\](.*)\[\/url\]|U","<a href='\\1'>\\1</a>",$c);
      

  3.   

    呵呵,我刚学正则,对PHP的几个正则函数还不是很熟悉,只学了MATCH——ALL,感觉够用了,就没看下去了~~~不过我想不通为什么我第一段代码不行,有什么错误吗?能解释一下吗?