search
  • Sign In
  • Sign Up
Password reset successful

Follow the proiects vou are interested in andi aet the latestnews about them taster

Programming Dictionary

Online technical manual for service programmers
Popular searches:
Dictionary homepage Server PHP php pathinfo() function
php pathinfo() function Detailed instructions for use

php pathinfo() function

Chinese translation Recent Updates: 2018-04-19 13:52:29

Return file path information

php pathinfo() function syntax

Function: Return file path information in the form of an array.

Syntax: pathinfo(path,options)

Parameters:

ParameterDescription
path Required. Specifies the path to be checked.
process_sectionsOptional. Specifies the array elements to be returned. The default is all. Possible values: PATHINFO_DIRNAME - only dirname is returned. PATHINFO_BASENAME - only basename is returned. PATHINFO_EXTENSION - only extension is returned.

Description: Returns an associative array containing path information. Includes the following array elements: [dirname], [basename], [extension]

php pathinfo() function example

<?php
$file = "/phpstudy/WWW/index.php";
print_r(pathinfo($file)) ;
?>

Run instance»

Click the "Run instance" button to view the online instance

Output:

Array ( [dirname] => /phpstudy/WWW [basename] => index.php [extension] => php [filename] => index )
php pathinfo() function