PHP Dirname


dirname() function is used to return a string containing the full path to remove the file name of the directory, the successful return of the string, otherwise return FALSE.

grammar:

string dirname(string path)

example:

Assuming the local access to the file URL address: http:// 127.0.0.1/html/test.php

echo $PHP_SELF; // output /html/test.php
echo dirname($PHP_SELF); // output /html

this function with thebasename()function is often used for URL handling.




Copyright 2014-2017 by DeveloperTut.com. All Rights Reserved.
TwitterGoogle+Facebook