PHP Manual

PHP function pathinfo()

2019-09-11T08:04:03.000Z

Obsah článku

Availability in versions: PHP 4.0.3

Returns information about a file path

Parameters

Parameter Data type Default value Note
$path string not The path being checked.
$options int null You can specify which elements are returned with optional parameter options. It composes from PATHINFO_DIRNAME, PATHINFO_BASENAME, PATHINFO_EXTENSION and PATHINFO_FILENAME. It defaults to return all elements.

Return values

mixed

The following associative array elements are returned:
dirname, basename,
extension (if any), and filename.



If options is used, this function will return a
string if not all elements are requested.

Other resources

Official pathinfo documentation

Jan Barášek   Více o autorovi

Autor článku pracuje jako seniorní vývojář a software architekt v Praze. Navrhuje a spravuje velké webové aplikace, které znáte a používáte. Od roku 2009 nabral bohaté zkušenosti, které tímto webem předává dál.

Rád vám pomůžu:

Související články

1.
171.

V jiných jazycích

Status:
All systems normal.
2025