Laman

Senin, 12 Desember 2011

Get or Fetch Image on Text

Description :
Get image / fetch image on text
Function :
$text = 'string or text you want that include image';
if((bool)preg_match('#<img[^>]+src=[\'"]([^\'"]+)[\'"]#', $text, $matches))
{
   $image = $matches[1];
}
else
{
   $image = '';
}

Tidak ada komentar:

Posting Komentar