PHP get img src
$string = '<img border="0" src="/images/image.jpg" alt="Image" width="100" height="100" />';
preg_match('@src=["']([^"']+)["']@', $string, $result);
print_r($result);
outputArray
(
[0] => src="/images/image.jpg"
[1] => /images/image.jpg
)
$string = '<img border="0" src="/images/image.jpg" alt="Image" width="100" height="100" />';
preg_match('@src=["']([^"']+)["']@', $string, $result);
print_r($result);
Array
(
[0] => src="/images/image.jpg"
[1] => /images/image.jpg
)