Error
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.

$youroriginalhtmlwithimage $firstimage

Extracting Image With PHP
Monday, 30 January 2012 17:11
//Extracting Image With PHP


$contenttograbimagefrom = $youroriginalhtmlwithimage;
$firstImage = "";
$output = preg_match_all('//i', $contenttograbimagefrom, $ContentImages);
$firstImage = $ContentImages[1] [0]; // To grab the first image
echo $firstImage;



credits: 4DLink WebLists and web4link.com

Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/FCytmxuZ_Ug/14559

 


Taxonomy by Zaragoza Online