php dirname

dirname in php may not be what you think it to be: given a full path name of a file, return its directory part. In fact, dirname(pathname) returns the parent directory of the parameter, wether it is a file or a directory, i.e.

dirname("C:\\dir\\file.txt") returns C:\dir,

dirname("C:\\dir") returns C:\, NOT C:\dir,

dirname("C:\\dir\\")  also returns C:\ ,

note that,

dirname("C:\\") returns  C:\

dirname("C:") returns C:

i.e., the dirname of root is the drive name. dirname("C") returns .(“C” is considered as a file under the current folder which is denoted by .)

Did you like this?
Tip admin with Cryptocurrency

Donate Bitcoin to admin

Scan to Donate Bitcoin to admin
Scan the QR code or copy the address below into your wallet to send some bitcoin:

Donate Bitcoin Cash to admin

Scan to Donate Bitcoin Cash to admin
Scan the QR code or copy the address below into your wallet to send bitcoin:

Donate Ethereum to admin

Scan to Donate Ethereum to admin
Scan the QR code or copy the address below into your wallet to send some Ether:

Donate Litecoin to admin

Scan to Donate Litecoin to admin
Scan the QR code or copy the address below into your wallet to send some Litecoin:

Donate Monero to admin

Scan to Donate Monero to admin
Scan the QR code or copy the address below into your wallet to send some Monero:

Donate ZCash to admin

Scan to Donate ZCash to admin
Scan the QR code or copy the address below into your wallet to send some ZCash:
Posted in

Leave a Reply