Share on Google+Share on Google+

PHPis_dir() Function and example

Advertisement
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

Advertisements

Posted on: October 30, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.