Get Image and Iframe from Description 

preg_match_all(‘/<img .*?(?=src)src=\”([^\”]+)\”/si’, stripslashes($result[‘items’][$i][‘content:encoded’]) , $image);
if (count($image[1]))
{
$result[‘items’][$i][‘image’] = array_unique($image[1]);
}

if (preg_match_all(‘~|~”, “(video) “, $description);

Get iframe src 
preg_match(‘/<iframe.*src=\”(.*)\”.*><\/iframe>/isU’, $value, $matches);
$iframeUrl = $matches[1];

Advertisements