pathinfo() works fine only when the extension is present.
WORKS FINE:
$sourceUrl = "site.com/image.png";
$photoExt = pathinfo($sourceUrl, PATHINFO_EXTENSION);
.
NOT WORKING
$sourceUrl = "www.gravatar.com/avatar/d9d3bffa0ca503c495b2461881688467?s=32&d=identicon&r=PG";
$photoExt = pathinfo($sourceUrl, PATHINFO_EXTENSION);
I couldn't see solution on how to get file/image extension when the source doesn't ended on it's file type.
Any solution?