O'Reilly logo

Programming PHP, 3rd Edition by Peter MacIntyre, Kevin Tatroe, Rasmus Lerdorf

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

pathinfo

Synopsis

mixed pathinfo(string path[, int options])

Returns an associative array containing information about path. If the options parameter is given, it specifies a particular element to be returned. PATHINFO_DIRNAME, PATHINFO_BASENAME, PATHINFO_EXTENSION, and PATHINFO_FILENAME are valid options values.

The following elements are in the returned array:

dirname

The directory in which path is contained.

basename

The basename (see basename) of path, including the file’s extension.

extension

The extension, if any, on the file’s name. Does not include the period at the beginning of the extension.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required