Oops, I forgot to make it also echo the text surrounding the image... here\'s the code to make it also do that.
function imagesize ($text) {
$imageurl=eregi(\"<IMAGE>([\\"]+)</IMAGE>\", $text, $image);
$size=getimagesize($image[1]);
$imagetag=\"<IMG SRC=\\"$image[1]\\" $size[3]>\";
$return=eregi_replace(\"$image[0]\", \"$imagetag\", $text);
return $return;
}
echo imagesize(\"blah blah blah <IMAGE>images/demo.gif</IMAGE> blah blah blah\");
That should do it.