/** getmessagepic()提取文章内容中的图片
* @param string $content
* @return string
*/
function getcontentpic($content) {
$pic = '';
$content = stripslashes($content);
$content = preg_replace("/\<img src=\".*?image\/face\/(.+?).gif\".*?\>\s*/is", '', $content); //移除表情符
preg_match("/src\=[\"\']*([^\>\s]{25,105})\.(jpg|gif|png)/i", $content, $mathes);
if(!empty($mathes[1]) || !empty($mathes[2])) {
$pic = "{$mathes[1]}.{$mathes[2]}";
}
return addslashes($pic);
}

相关文章:

  • 2021-11-27
  • 2021-05-10
  • 2022-12-23
  • 2021-12-15
  • 2021-10-29
  • 2021-11-07
  • 2021-12-10
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-30
  • 2021-06-28
  • 2022-12-23
  • 2021-11-09
  • 2022-12-23
相关资源
相似解决方案