I'm assuming you want to pull out just the path part and ignore query parameters or hash values in the URL.
I would suggest using parse_url() (documented here: http://php.net/manual/en/function.parse-url.php) to pull out the path.
$url = 'www.mysite.com/uploads/09/03/myimage.png';
$path = parse_url($url, PHP_URL_PATH);
$parts = explode('/', $path);
$output = array_slice($parts, -3, 3);
var_dump($output);
This will provide you with an array of the last 3 parts of the path and handles cases like query strings and hash values in the array, of course you will still need to do basic length validation to ensure this logic still holds.
parse_urlbut as its not a valid url you need to useregexorexplodefunction instead