Name

pathinfo

Synopsis

array pathinfo(string path)

Returns an associative array containing information about path. 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.

Get Programming PHP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.