$html = file_get_contents('https://website.com');
$regex = '/< *img[^>]*src *= *["\']?([^"\']*)/i';
preg_match_all($regex, $html, $matches)
return($matches[1][1]['src']);
The problem is that the image URL that I want to return is broken because the URL in the view: source is a blue link means it's clickable, and after getting clicked it becomes a new URL, and that's the URL which I want to return not the unclicked one. hope you understand, I want to return the address source of the URL which is different from the actual URL.