public static function getEmbedFromLink($link, $width = 0, $height = 0) { $matches = array(); if (preg_match("/http:\\/\\/www\\.youtube\\.com\\/watch\\?v\\=(?<id>[\\w_-]+)/", $link, $matches)) { return Stuffpress_Services_Webparse::getEmbedYoutube($matches['id'], $width, $height); } else { if (preg_match("/http:\\/\\/vimeo\\.com\\/(?<id>\\w+)/", $link, $matches)) { return Stuffpress_Services_Webparse::getEmbedVimeo($matches['id'], $width, $height); } else { return false; } } }