Jump to content

Archived

This topic is now archived and is closed to further replies.

glenelkins

Extracting Code From HTML

Recommended Posts

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:

[code]
<?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);
    }
    
?>
[/code]

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 "".

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.