I am getting page content using:
$data = file_get_contents($url);
Now I want to extract
- image and
- data part leaving script and html code.
This is regex for image I used:
function get_logo($data)
{
return preg_match("/<img(.*?)src=(\"|\')(.+?)(gif|jpg|png|bmp)(\"|\')(.*?)(\/)?>(<\/img>)?/", $html, $matches) ? $matches[1] : '';
}
which returns nothing.