pathinfo
Returns the file path information
pathinfo()
function returns the information about the file path as an array.
<?php print_r ( pathinfo ( "/testweb/test.txt" ) ) ; ?>
Output:
Array ( [dirname] => /testweb [basename] => test.txt [extension] => txt )
<?php print_r ( pathinfo ( "/testweb/test.txt" , PATHINFO_BASENAME ) ) ; ?>
Output:
test.txt
pathinfo ( path , options )
parameter | describe |
---|---|
path | Required. Specify the path to be checked. |
process_sections |
Optional. Specifies the array element to be returned. The default is all. Possible values:
|
pathinfo()
returns an associative array containing path information.
Includes the following array elements: