Gen. partnerAlgotech

PHP function pathinfo()

Returns information about a file path

|
September 11, 2019

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

Loading comments...

Stay in the loop

Subscribe to our newsletter and get the latest cybersecurity news delivered straight to your inbox.

Your data is safe. You can unsubscribe from the newsletter at any time.