Share on Google+Share on Google+

The file_exists() function, file_exists php, file_exists in php

This example of file_exists() function in PHP that checks the existence of a file or directory.

The file_exists() function returns TRUE if the file or directory specified by filename exists; FALSE otherwise. 

Syntax of file_exists() Function PHP

bool file_exists (file_name )

It test the existence of the file or the directory given as argument name

It return true if the file or the directory given is existing 

If Not existing then it returns FALSE

Code for file_exists() Function PHP 


echo "file is existing ".file_exists("c:/rose1/ram.txt");

echo "<br>file is existing ".file_exists("c:/rose1/ram1.txt");






Posted on: September 22, 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.