SQL PHP HTML ASP JavaScript articles and free scripts to download
PHP File Function

file_exists function

In our script before executing a program we need to check if file exists or not. This file check method by using file_exists function check the presence of file from relative path we specify and then returns TRUE of False based on the presence of the file.

We can best use file_exists function along with an if condition.

Here is a sample code.

$add="images/119.jpg";
if(file_exists($add)){
echo "Yes file is there ";
}else{echo "Sorry no file at $add ";}

Number of User Comments : 1


Google+
Anand17-08-2010
It helps me 2 much. Thanks
Post Comment This is for short comments only. Use the forum for more discussions.
Name
Email( not to be displayed)Privacy Policy
1+2=This is to prevent automatic submission by spammers. Please enter the result of the sum as asked



HTML . MySQL. PHP. JavaScript. ASP. Photoshop. Articles. FORUM Contact us

©2000-2014 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer