pathinfo () PHP function

pathinfo () returns information about a file path in the form of an array

Returned as array elements

[Dirname]: File Path

[Basename]: filename

[Extension]: file extension

[Filename]: file name does not contain a suffix

grammar:

path Required. To check the specified path.
options Optional. The provisions of the array elements to return. The default is all.
Possible values:
PATHINFO_DIRNAME - returns only dirname
PATHINFO_BASENAME - only to return basename
PATHINFO_EXTENSION - only to return Extension
PATHINFO_FILENAME - returns only the filename

Examples

Export

Array ( [dirname] => /11 [basename] => test.php [extension] => php [filename] => test )

Guess you like

Origin www.cnblogs.com/rjbc/p/11414577.html