Home >> PHP >> basename() function in PHP

basename() function in PHP

The basename() function returns the filename from component of path.

Syntax

basename(filepath,suffix)

Example

echo basename("/content/people.txt");

echo basename("/content/people.txt",".txt");

Output

people.txt

people

 

 

Post Your Comment

Next Questions
chgrp() function
chmod() function
chown() function
clearstatcache() function
copy() function
delete() function
dirname() function
disk_free_space() function
disk_total_space() function
diskfreespace() function
feof() function
fflush() function
fgetc() function
fgetss() function
file_put_contents() function
fileatime() function
filectime() function
filemtime() function
fileowner() function
fileperms() function
filesize() function
filetype() function
flock() function
fputs() function
fscanf() function

Copyright ©2022 coderraj.com. All Rights Reserved.