兄弟,能不能写一点啊,谢谢我刚在论坛上搜索用这个但不行啊---------------------------------------------------------------------------------------------------------------------------preg_replace("#(<img.+?src=(['\"]?))([^   >]+)(\/.+?)\\2#", "\\1images\\4\\2", $topic_rowset[$i]['post_text']);

解决方案 »

  1.   

    /**
    * @name take_img
    * @todo 提取文章中的图片链接
    * @param $str 
    *  文章内容
    * @return array
    *  返回一个数组,里面保存该文章中所有的图片链接
    * @author kapil
    */
    function take_img($str)
    {
    $ereg = '/http:\/\/.*(\.(jpg)|(gif)|(jpeg))/iU'; if(preg_match_all($ereg,$str,$r))
    {
    $array = $r[0];
    return $array;
    }
    else
    {
    return false;
    }
    }
      

  2.   

    kapil() 谢谢你,那我怎样让图片显示出来啦,谢谢$post_img_text=preg_replace('/http:\/\/.*(\.(jpg)|(gif)|(jpeg))/iU', $topic_rowset[$i]['post_text']);怎么套用上面上面那个,谢谢