Regex & PHP - isolate src attribute from img tag

前端 未结 10 1438
眼角桃花
眼角桃花 2020-11-28 08:55

With PHP, how can I isolate the contents of the src attribute from $foo? The end result I\'m looking for would give me just \"http://example.com/img/image.jpg\"



        
10条回答
  •  隐瞒了意图╮
    2020-11-28 10:02

    preg_match solves this problem nicely.

    See my answer here: How to extract img src, title and alt from html using php?

提交回复
热议问题