PHP pathinfo() Function

PHP pclose() Function
PHP parse_ini_string() Function

In this article, you will learn how to get the following information in PHP.

  • Directory name
  • Basename
  • Extension of file
  • Filename

PHP pathinfo() returns the above information for a path in PHP.

what is the syntax of the PATHINFO function in php?

pathinfo(path, options)
pathRequired. Specifies the path to be checked
optionsOptional. Specifies which array element to return. If not specified, it returns all elements.Possible values:PATHINFO_DIRNAME – return only dirnamePATHINFO_BASENAME – return only basenamePATHINFO_EXTENSION – return only extensionPATHINFO_FILENAME – return only filename

examples of the PATHINFO function

Example 1. In this example, we get information about a file path.

PHP pclose() Function
PHP parse_ini_string() Function
en English
Scroll to Top