basename()函数可返回路径中的文件名部分。
语法
string basename ( string path [, string suffix] )
它给出了一个包含文件路径的字符串,并且此函数返回文件的基本名称。如果文件名以后缀结尾,也可以将其截断。
在线示例
<?php
$path = "/PhpProject/index.php";
$file = basename($path); // $file 设置为 "index.php"
echo $file . "\n";
$file = basename($path, ".php"); // $file 设置为 "index"
echo $file;
?>
输出结果
index.php index
PHP mysqli_stmt_execute() PHP mysqli_stmt_error()
展开全部