dirname /basename 父路径 / 基础文件
最后更新于:2022-04-02 02:30:29
[TOC]
## 示例
## dirname 获取父路径
```
echo dirname("/usr/local/lib") . PHP_EOL; // /usr/local
echo dirname("/usr/local/lib", 2) . PHP_EOL; // /usr
```
## basename 基础文件
```
echo basename("/home/janbodnar/prog/phpfiles/myfile.txt") . PHP_EOL;
// myfile.txt
echo basename("/home/janbodnar/prog/phpfiles/myfile.txt", ".txt") . PHP_EOL;
// myfile
```
';