How can i get all picture urls in a page with php. I think we can make it with php but i couldn't do it
How about this: <?PHP $page = file_get_contents('a.txt'); $img_ext[] = 'gif'; $img_ext[] = 'png'; $img_ext[] = 'jpg'; $img_ext[] = 'jpeg'; $img_ext[] = 'bmp'; preg_match_all("|src\=([\"'`])(.+?)\\1|i", $page, &$matches); foreach ($matches[2] as $val) { $file = basename($val); $split_file = split('\.', $file); if (in_array($split_file[1], $img_ext)) $image_array[] = $val; } echo '<pre>'; print_r($image_array); echo '</pre>'; ?> PHP: