1234567891011121314151617181920212223 |
- <?php
- function getExtension($filename, $isURI = false) {
-
- if ($isURI===true) $filename = parse_url($filename, PHP_URL_PATH);
- $extension = pathinfo($filename, PATHINFO_EXTENSION);
-
- if (strpos($extension, ':')!==false) list($extension, ) = explode(':', $extension, 2);
- if (empty($extension)===false) $extension = '.' . $extension;
- return $extension;
- }
- ?>
|