$path = "/home/httpd/html/index.php"; $file = basename($path); // $file is set to "index.php" $file = basename($path,".php"); // $file is set to "index"
dirname:
$path = "/etc/passwd"; $file = dirname($path); // $file is set to "/etc"
一个是取出目录名
一个是取出文件名
时间: 2024-10-14 16:36:07