<?php
preg_match_all( "/<img.*https?:\/\/[^\/]+\/([^\"']+)[\"'].*/i", "<img src='http://google.com/test/test/test/test.png' width='test'>", $match);

echo $match[1][0];