Any preg_match() to extract image urls from text?

后端 未结 3 704
半阙折子戏
半阙折子戏 2020-12-06 03:19

i need a preg_match() syntax or something similar to extract JPG or PNG or GIF URLs from a m

3条回答
  •  旧巷少年郎
    2020-12-06 04:11

    $matches = array();
    preg_match_all('!http://.+\.(?:jpe?g|png|gif)!Ui' , $string , $matches);
    

提交回复
热议问题