hello guys, again, i have this code that grab all imgs like that <img src='linkhere.jpg' /> but what if the img like that <img id='imgid' height='100' width='100' src='linkhere.jpg' /> so it not going to get it cuz the src at the end of the code so i want some one to update my code and make it just read the images in the page where ever the src was here is my code preg_match_all("/(<img)\s (src=\"( [a-zA-Z0-9\.;:\/\?&=_|\r|\n] (.*) \.(jpg|png) )\")/isxmU", file_get_contents($url), $images) PHP: thanks for anyhelp
here is all of the code if(preg_match_all("/(<img)\s (src=\"( [a-zA-Z0-9\.;:\/\?&=_|\r|\n] (.*) \.(jpg|png) )\")/isxmU", file_get_contents($_SESSION['url']), $images)){ /* limit number of images shown */ $limit = 4; $i=0; foreach($images[3] as $image_url): $valid_files = substr($image_url, -3); if($valid_files == "png" || $valid_files == "jpg"){ if(dose_url_exists($image_url)){ $i++; if($i == $limit) break; $image_hash = md5($image_url); $image_ext = substr($image_url, -3); ?> <td style="float:left; margin:0 10px;"><img src="<?php echo $image_url; ?>" /></td> <?php } } endforeach; ?> PHP: