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