How can i check if http is present in img tag

Discussion in 'PHP' started by ade92uk, Feb 4, 2009.

  1. #1
    I have tried:

    $urlres = preg_match_all('#<img[^>]*?>#si', $site, $matches);
    $checkhttp = preg_match('#src="http#si', $matches[0][$i], $checked);
    
    if ($urlres = true) {for($i = 0, $size = sizeof($matches[0]); $i < $size; ++$i)
    					{
    					
    					if ($checkhttp != true):
    					$pattern = '#src="http:#';
    					$replacement = 'src="';
    					$replacement .= $link2;
    					$string = $matches[0][$i];
    					$result = preg_replace($pattern, $replacement, $string);
    					echo $string;
    					else:
    					echo $matches[0][$i];				
    					endif;
    					
    					
    					
    
    }
    					}
    Code (markup):
    can someone help me please
     
    ade92uk, Feb 4, 2009 IP