Unix and Linux Discussions Tagged with sudoers |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
5 |
15,984 |
Linux |
|
|
|
3 |
2,384 |
UNIX for Beginners Questions & Answers |
|
|
|
5 |
7,356 |
HP-UX |
|
|
|
2 |
3,418 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
11,987 |
Emergency UNIX and Linux Support |
|
|
|
15 |
4,775 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
2,308 |
UNIX for Advanced & Expert Users |
|
|
|
2 |
4,860 |
OS X (Apple) |
|
|
|
0 |
5,098 |
Linux |
|
|
|
4 |
2,691 |
Red Hat |
|
|
|
1 |
5,821 |
UNIX for Advanced & Expert Users |
|
|
|
5 |
7,599 |
UNIX for Dummies Questions & Answers |
|
|
|
6 |
10,600 |
Solaris |
|
|
|
4 |
11,247 |
Shell Programming and Scripting |
|
|
|
2 |
4,948 |
UNIX for Dummies Questions & Answers |
|
|
|
5 |
7,894 |
UNIX for Advanced & Expert Users |
|
|
|
2 |
24,622 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
4,914 |
UNIX for Dummies Questions & Answers |
BASENAME(3) 1 BASENAME(3)
basename - Returns trailing name component of path
SYNOPSIS
string basename (string $path, [string $suffix])
DESCRIPTION
Given a string containing the path to a file or directory, this function will return the trailing name component.
PARAMETERS
o $path
- A path. On Windows, both slash ( /) and backslash ( ) are used as directory separator character. In other environments, it is
the forward slash ( /).
o $suffix
- If the name component ends in $suffix this will also be cut off.
RETURN VALUES
Returns the base name of the given $path.
EXAMPLES
Example #1
basename(3) example
<?php
echo "1) ".basename("/etc/sudoers.d", ".d").PHP_EOL;
echo "2) ".basename("/etc/sudoers.d").PHP_EOL;
echo "3) ".basename("/etc/passwd").PHP_EOL;
echo "4) ".basename("/etc/").PHP_EOL;
echo "5) ".basename(".").PHP_EOL;
echo "6) ".basename("/");
?>
The above example will output:
1) sudoers
2) sudoers.d
3) passwd
4) etc
5) .
6)
NOTES
Note
basename(3) operates naively on the input string, and is not aware of the actual filesystem, or path components such as " ..".
Note
basename(3) is locale aware, so for it to see the correct basename with multibyte character paths, the matching locale must be set
using the setlocale(3) function.
SEE ALSO
dirname(3), pathinfo(3).
PHP Documentation Group BASENAME(3)