如何使用PHP从完整路径获取文件名?例如,我如何获得Output.map从…F:\Program Files\SSH Communications Security\SSH Secure Shell\Output.map用PHP?
3 回答
catspeake
TA贡献1111条经验 获得超0个赞
PATHINFO
<?php $xmlFile = pathinfo('/usr/admin/config/test.xml'); function filePathParts($arg1) { echo $arg1['dirname'], "\n"; echo $arg1['basename'], "\n"; echo $arg1['extension'], "\n"; echo $arg1['filename'], "\n"; } filePathParts($xmlFile);?>
/usr/admin/config test.xml xml test
$fullPath = $xmlFile['dirname'] . '/' . $xmlSchema['basename'];
- 3 回答
- 0 关注
- 429 浏览
添加回答
举报
0/150
提交
取消