hi guys, I really need help on how to check the page (html page) for images / image file and display the url of the images. I'm searching for almost a week for the sample code but i can't find anything. What are the syntax that im going to use? Please help me with this I badly need this in my project. Thanks in Advance.
I have just written and tried this code: <?php // Get page srouce $s = file_get_contents('actual_url_to_the_page'); $pattern = '/<img[^>]+src=([\'"]?)([^>"\']+)\1[^>]*\/>/is'; // Apply regexp pattern to the content preg_match_all($pattern, $s, $matches); // Print URLs print_r($matches[2]); ?> PHP: The key is preg_match_all() function call with the corresponding pattern.