Bu soru oldukça eski olduğunu biliyorum, ama birisi aynı şeyi arıyoruz vurur sadece durumda cevap olacak.
YouTube, Vimeo, Wordpress, Slideshare, Hulu, Flickr ve diğer birçok hizmet için oEmbed (http://oembed.com/) kullanın. Listede olmayan ya da bunu daha kesin yapmak istiyorsanız, bunu kullanabilirsiniz:
http://simplehtmldom.sourceforge.net/
(: Bütün görüntüler, bir div içeriğini almak, vs, bir düğümün içeriği) (hayır HTML yalnızca metin dönmek yani) Bu kod parçalarını almak için HTML seçicileri kullanabilirsiniz anlamı, PHP için jQuery bir çeşit.
Böyle bir şey (daha şık yapılabilir ama bu sadece bir örnek olabilir) yapabilirdi:
require_once("simple_html_dom.php");
function getContent ($item, $contentLength)
{
$raw;
$content = "";
$html;
$images = "";
if (isset ($item->content) && $item->content != "")
{
$raw = $item->content;
$html = str_get_html ($raw);
$content = str_replace("\n", "<BR /><BR />\n\n", trim($html->plaintext));
try
{
foreach($html->find('img') as $image) {
if ($image->width != "1")
{
// Don't include images smaller than 100px height
$include = false;
$height = $image->width;
if ($height != "" && $height >= 100)
{
$include = true;
}
/*else
{
list($width, $height, $type, $attr) = getimagesize($image->src);
if ($height != "" && $height >= 100)
$include = true;
}*/
if ($include == true)
{
$images = $images . '<div class="theImage"><a href="'.$image->src.'" title="'.$image->alt.'"><img src="'.$image->src.'" alt="'.$image->alt.'" class="postImage" border="0" /></a></div>';
}
}
}
}
catch (Exception $e) {
// Do nothing
}
$images = '<div id="images">'.$images.'</div>';
}
else
{
$raw = $item->summary;
$content = str_get_html ($raw)->plaintext;
}
return (substr($content, 0 , $contentLength) . (strlen ($content) > $contentLength ? "..." : "") . $images);
}