Location: PHPKode > scripts > Thumb and Watermark Generator > classes/class.util.php
<?php
class Util
{
	function __construct(){}
	function isImage($val)
	{
		$imageTypeArray = array("jpeg","jpg","gif","png"); 
		$info = explode("/",$val);
		
		if($info[0]==='image')
		{
			$ext = end($info);
			$ext = strtolower($ext);
			
			if(in_array($ext,$imageTypeArray))
			{
				return true;
			}
			else
			{
				return false;
			}
		}
		else
		{
			return false;
		}
	}
	function getImageExt($val)
	{
		$ext =explode(".",$val);
		return end($ext);
		
	}
}
?>
Return current item: Thumb and Watermark Generator