物理截取 $file = '/www/htdocs/inc/lib.inc.php'; $filename = basename($file); echo $filename, '';// lib.inc.php $filename = str_replace(strrchr($filename, '.'), '', $filename); echo $filename, '';// lib.inc 使用pathinfo($path, $options) $file = '/www/htdocs/inc/lib.inc.php'; $path_parts = pathi