$path
[, string $suffix
] )
Given a string containing the path to a file or directory, this function will return the trailing name component.
Anonymous user / 18.226.34.143 Log In Register |
?
Wallet:
3.00
Daily Credits:
1.20 / 1.20
|
This is your credit balance. Even if you are an anonymous user, you are given some credits to spend. Every IP address has its own account and it is provided with free credits that can be used to pay for Online Domain Tools services. Moreover, credit balance is reset every day. This is why we call them Daily Credits. Registered users have higher Daily Credits amounts and can even increase them by purchasing subscriptions.
Besides Daily Credits, all accounts, including IP address accounts of anonymous users, have their credit Wallet. Wallet credits are not reset on a daily basis, but they are only spent when a user has not enough Daily Credits. Registered users can buy credits to their wallets. All IP address accounts are created with an initial Wallet balance of 3.00. Once IP address account spends credits from its Wallet, it can not be charged again. This should allow new users to try most of Online Domain Tools services without registration.
$path
[, string $suffix
] )
Given a string containing the path to a file or directory, this function will return the trailing name component.
A path.
On Windows, both slash (/) and backslash (\) are used as directory separator character. In other environments, it is the forward slash (/).
If the name component ends in suffix
this will also
be cut off.
Returns the base name of the given path
.
Example #1 basename() example
<?php
echo "1) ".basename("/etc/sudoers.d", ".d").PHP_EOL;
echo "2) ".basename("/etc/passwd").PHP_EOL;
echo "3) ".basename("/etc/").PHP_EOL;
echo "4) ".basename(".").PHP_EOL;
echo "5) ".basename("/");
?>
The above example will output:
1) sudoers 2) passwd 3) etc 4) . 5)
Version | Description |
---|---|
4.1.0 |
The suffix parameter was added
|
Note:
basename() operates naively on the input string, and is not aware of the actual filesystem, or path components such as "..".
Note:
basename() is locale aware, so for it to see the correct basename with multibyte character paths, the matching locale must be set using the setlocale() function.