PHP directry functions

Functions Description
scandirList of All files and directories present inside a directory
getcwdGet Current working directory details
chdirChange the current directry to new directory

dirname to gate name of the directoy and path

We can get directy name from the string we provide as input.

$var='http://www.plus2net.com/sql_tutorial/math.php';
echo dirname($var);

Output is here

http://www.plus2net.com/sql_tutorial

is_dir to check if directory name is true or not

is_dir() function returns True or False to know if file name is directory or not. We will check by if condition.

$var='test_dir';
if(is_dir($var)){
echo "This is a directory : $var ";
}else{
echo "This is NOT a directory : $var ";
}

Subscribe to our mailing list

* indicates required
Subscribe to plus2net
Your Rating


Google+

Post Comment This is for short comments only. Use the forum for more discussions.




Subscribe to our mailing list

* indicates required
Subscribe to plus2net
HTML . MySQL. PHP. JavaScript. ASP. Photoshop. Articles. FORUM Contact us
©2000-2016 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer