取出目录路径中的文件名字

code

<?php
$path = "/testweb/home.php";

//Show filename with file extension
echo basename($path) ."<br/>";

//Show filename without file extension
echo basename($path,".php");
?>

输出

home.php
home

 

参考:

https://www.runoob.com/php/func-filesystem-basename.html

 

 

 

相关文章:

  • 2022-12-23
  • 2022-01-13
  • 2021-11-28
  • 2021-12-24
  • 2021-09-19
  • 2021-08-17
猜你喜欢
  • 2021-08-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案