It's a shame, that for a 20 years of development we don't have mb_basename() yet!// works both in windows and unixfunction mb_basename($path) { if (preg_match('@^.*[\\\\/]([^\\\\/]+)$@s', $path, $matches)) { return $matches[1]; } else if (preg_match('@^([^\\\\/]+)$@s', $path, $matches)) { return $matches[1]; } return '';}