An easy example to help understanding this function...
<?
$loadFile = "http://static.php.net/images/php.gif";
$im = imagecreatefromstring(file_get_contents($loadFile));
// identical to imagecreatefromgif($loadFile);
imagegif($im);
?>
The function will try to auto-determine file format (jpg, gif, png....), and will return false if fails.