本帖最后由 xiangdeweiwangfengg 于 2009-10-25 10:59:34 编辑

解决方案 »

  1.   

    $str = "<img src='attachments/month_0910/s2009102391151.gif' border='0' alt=''/>";
    echo preg_replace("/(src=')/","$1http:\/\/www.ccav.com\/",$str);
      

  2.   

    $str = "<img src=\"attachments/month_0910/s2009102391151.gif\" border=\"0\" alt=\"\"/>";
    echo preg_replace("/(src=\")/","$1http:\/\/www.ccav.com\/",$str);
      

  3.   

    $str = "<img src=\"attachments/month_0910/s2009102391151.gif\" border=\"0\" alt=\"\"/>";
    echo preg_replace("/(src=\")/","$1http:\/\/www.ccav.com\/",$str);