File exist

I like to find whether a file is exist in the same folder or not.
The following would-be code doesn’t work correctly, but it will show what I want.

[b]would-be code[/b]

<?php
if ( fileExist("myFile.php") )
{echo "Yes, the file which is named "myFile.php" is existed in the folder." }
else
{echo "No, the file which is named "myFile.php" is NOT existed in the folder." }
?>

This is probably what you’re looking for:

http://php.net/manual/en/function.file-exists.php


if (file_exists('myFile.php')) {
    echo "The file myFile.php exists";
} else {
    echo "The file myFile.php does not exist";
}

use file_exists ( string $filename )
instead of fileExists in your code:)

Always search the PHP.net site it has tons of info