PHP function is_file() and example

This segment of the PHP tutorial illustrates the use of file handling function fwrite() and its example

 
 

Share on Google+Share on Google+

PHP function is_file() and example

Ads

This segment of the PHP tutorial illustrates the use of file handling function fwrite() and its example

  • bool_is_file function states whether the given file is regular file or not

Syntax

bool is_file(file_name)


Example of PHP is_file() PHP
Code
<?php

    $a
=is_file("bb.txt");
    if
($a)
      echo
"bb.txt is a file";
    else
       echo
"bb.txt is not a file";
    echo
"<br/>";

    $a
=is_file("c:\rose1");
    if
($a)
      echo
"rose1 is a file";
    else
      echo
"rose1 is not a file";
?>

Outpu
t
bb.txt is a file
rose1 is not a file

Advertisements

Ads

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