| 1 |
<?php
|
| 2 |
// $Id: pathinfo_filename.inc,v 1.1.2.1 2007/11/06 13:20:41 kratib Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* Taken from http://www.php.net/manual/en/function.pathinfo.php#77748
|
| 6 |
*/
|
| 7 |
if (!function_exists('pathinfo_filename')) {
|
| 8 |
if (version_compare(phpversion(), "5.2.0", "<")) {
|
| 9 |
function pathinfo_filename($path) {
|
| 10 |
$temp = pathinfo($path);
|
| 11 |
if ($temp['extension']) {
|
| 12 |
$temp['filename'] = substr($temp['basename'], 0, strlen($temp['basename'])-strlen($temp['extension'])-1);
|
| 13 |
} else {
|
| 14 |
$temp['filename'] = $temp['basename'];
|
| 15 |
}
|
| 16 |
return $temp;
|
| 17 |
}
|
| 18 |
} else {
|
| 19 |
function pathinfo_filename($path) {
|
| 20 |
return pathinfo($path);
|
| 21 |
}
|
| 22 |
}
|
| 23 |
}
|
| 24 |
?>
|