|
dirnameReturns a parent directory's path Description
string dirname(string
$path , int $levels = 1)
Given a string containing the path of a file or directory, this function
will return the parent directory's path that is
Caution
On Windows, dirname assumes the currently set codepage, so for it to see the
correct directory name with multibyte character paths, the matching codepage must
be set.
If
On other systems, dirname assumes Parameters
Return Values
Returns the path of a parent directory. If there are no slashes in
Caution
Be careful when using this function in a loop that can reach the top-level directory as this can result in an infinite loop.
Changelog
Examples
Example #1 dirname example
The above example will output something similar to: /etc / (or \ on Windows) . C:\ /usr See Also
|