Jump to content


Photo

Extracting Code From HTML


  • Please log in to reply
No replies to this topic

#1 glenelkins

glenelkins
  • Members
  • PipPipPip
  • Advanced Member
  • 760 posts
  • LocationBridlington - East Riding of Yorkshire - United Kingdom

Posted 28 May 2006 - 12:26 PM

I have a project where as i have to get some HTML code and take out an image from <img src> tag.
Now i get the file in the following way:

<?php
    $prods = "http://1564.tchosts3.net/TEMPLATES/Template2/product.asp?intProdID=SVFUJ-879133-001";
    $data = file($prods);
                foreach ($data as $dt) {
        $content=htmlentities($dt);
        echo nl2br($content);
    }
    
?>

How do i check each of these lines in the loop to find the <img src=> tag, then to return only the text (filename of image) between the "".
http://thewebsolutionprovider.com - A Solution For Everything Web!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users