pathinfo() returns an associative array
containing information about path
. The
following array elements are returned:
dirname, basename
and extension if any.
You can specify which elements are returned with optional parameter
options
. It composes from
PATHINFO_DIRNAME,
PATHINFO_BASENAME,
PATHINFO_EXTENSION and
PATHINFO_FILENAME (available since PHP 5.2.0). It
defaults to return all elements. This function returns string if not all
elements are requested.
Note: For information on retrieving the current path info, read the section on predefined reserved variables.
See also dirname(), basename(), parse_url() and realpath().