Home Tutorial Php Phpfiles The file_exists() function, file_exists php, file_exists in php

 
 

The file_exists() function, file_exists php, file_exists in php
Posted on: September 22, 2009 at 12:00 AM
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 

<?php

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

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

?>

 

 

Related Tags for The file_exists() function, file_exists php, file_exists in php:


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.