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 dirname() function
php dirname() function Detailed instructions for use

php dirname() function

Chinese translation Recent Updates: 2018-04-19 13:49:53

Directory name; return the directory part of the path; directory name

php dirname() function syntax

Function: Return the directory part of the path.

Syntax: dirname(path)

Parameters:

Parameter Description
path Required. Specifies the path to be checked.

Explanation: The path parameter is a string containing the full path to a file. This function returns the directory name after removing the file name.

php dirname() function example

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

Run instance»

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

Output:

/phpstudy/WWW
php dirname() function