开发者

php - quick help needed with preg_replace

开发者 https://www.devze.com 2023-01-18 04:49 出处:网络
I\'m parsing rss feeds however some feeds have what look to be blank images in them (from feedburner). Can somewhere help me out with a preg_replace command 开发者_如何学编程to find and remove an imag

I'm parsing rss feeds however some feeds have what look to be blank images in them (from feedburner). Can somewhere help me out with a preg_replace command 开发者_如何学编程to find and remove an image tag structured like:

<img src="http://feeds.feedburner.com/sdfasdfsfd" height="1" width="1"/>

Thanks!


I guess the "sdfasdfsfd" is something random:

$text = preg_replace( '#<img src="http://feeds.feedburner.com/[a-z]+" height="1" width="1"/>#i', '', $text );
0

精彩评论

暂无评论...
验证码 换一张
取 消