function checkExternal ($src) {
$allowedSites = array(
'flickr.com',
'picasa.com',
'blogger.com',
'wordpress.com',
'img.youtube.com',
);
if (preg_match('/http:\/\//', $src) == true) {
$url_info = parse_url ($src);
$isAllowedSite = false;
foreach ($allowedSites as $site) {
$site = '/' . addslashes($site) . '/';
if (preg_match($site, $url_info['host']) == true) {
$isAllowedSite = true;
}
}
Cheers