/** * Validate input has an extension and is in the whitelist. * * @uses Titon\Utility\Loader * * @param string $input * @param string|array $extensions * @return bool */ public static function ext($input, $extensions = array('gif', 'jpeg', 'png', 'jpg')) { if (is_array($input) && isset($input['name'])) { $input = $input['name']; } return in_array(Path::ext($input), (array) $extensions, true); }
function ext($string) { return Path::ext($string); }