$preg = '/<img.*?src=[\"|\']?(.*?)[\"|\']?\s.*?>/i';//匹配img标签的正则表达式
  preg_match_all($preg, $newsInfo['content'], $array);//这里匹配所有的img
 preg_replace('#src="/#is', 'src=" ' .$staticHost . '/',$
newsInfo['content']);//匹配所有src并添加url

匹配img标签的正则表达式

 

相关文章:

  • 2021-12-24
  • 2022-12-23
  • 2021-09-10
  • 2021-11-19
  • 2021-10-07
  • 2022-12-23
  • 2021-07-12
  • 2021-09-11
猜你喜欢
  • 2021-10-19
  • 2022-12-23
  • 2022-12-23
  • 2021-06-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案