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

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.

Ads

Advertisement