pathinfo

PHP 4 >= 4.0.3, PHP 5, PHP 7, PHP 8
pathinfo - Returns information about a file path

Example #1 pathinfo Example

Result: /www/htdocs/inc lib.inc.php php lib.inc
PHP Version:

Example #2 pathinfo example showing difference between null and no extension

Result: string(0) "" Notice: Undefined index: extension in test.php on line 6 NULL
PHP Version:

Example #3 pathinfo example for a dot-file

Result: Array ( [dirname] => /some/path [basename] => .test [extension] => test [filename] => )
PHP Version:


Example #4 of pathinfo

PHP Version:


Function pathinfo:

Filesystem Functions

Most used PHP functions