How to extract all URLs inside <img>?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mike Ritter

    How to extract all URLs inside <img>?

    Hi,

    I know it could maybe be done with preg_match_all but I dont have any Idea
    how to do that.
    Anyone knows how can I extract all URLs inside the IMG Tags? (<img
    src="???">)

    Thanks a lot, Mike.


  • Philipp Neuhaus

    #2
    Re: How to extract all URLs inside &lt;img&gt;?

    There's an answer in de.com.lang.php .misc.........

    Comment

    • R. Rajesh Jeba Anbiah

      #3
      Re: How to extract all URLs inside &lt;img&gt;?

      "Mike Ritter" <mfilebox1@gmx. de> wrote in message news:<bj05dq$so s$01$1@news.t-online.com>...[color=blue]
      > Hi,
      >
      > I know it could maybe be done with preg_match_all but I dont have any Idea
      > how to do that.
      > Anyone knows how can I extract all URLs inside the IMG Tags? (<img
      > src="???">)[/color]

      preg_match_all( "/<img src=\"([^']*?)\">/", $html, $matches);
      print_r($matche s);

      Disclaimer: Not tested.

      Comment

      Working...