Home Tutorial Php Phpfiles PHPis_dir() Function and example

 
 

PHPis_dir() Function and example
Posted on: October 30, 2009 at 12:00 AM
This segment of the PHP tutorial illustrates the use of file handling function is_dir() and its example

Syntax

bool is_dir(file_name);

  • The PHP is_dir() function states that whether the given path is the directory or the file
  • It returns 1 if the given path is directory


Example of PHP is_dir() Function PHP

Code
<?php

    echo
"is this directory".is_dir("c:/rose1");
    echo
"<br>is this directory".is_dir("c:/rose1/ram.txt");
?>

Output
is this directory1
is this directory

Related Tags for PHPis_dir() Function and example:


Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.