<?
function image_read($wr_content) {
	$img_content = stripslashes($wr_content);
	$img_content = str_replace("&lt;", "<", $img_content);
	$img_content = str_replace("&gt;", ">", $img_content);
	$patten = "/<img[^>]*src=[\"']?([^>\"']+)[\"']?[^>]*>/i";
	if (preg_match_all($patten, $img_content, $match))
		return $match;
	else 
		return false;
}

function image_delete_run($wr_content) {
	$match = image_read($wr_content);	
	if ($match) {
		foreach ($match[1] as $link) {
			$url		= parse_url($link);
			$saveFileName = $url[path];
			if (file_exists($saveFileName)) 
				@unlink($saveFileName);
		}
	}
}
?>