Code:
code
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." }

result
Yes, the file which is named "myFile.php" is existed in the folder.
The code above confirm whether "myFile.php" is existed or not in the directory.

I like to get all files in the directory.

The code below doesn't work correctly, but I hope it shows what I want.
Code:
would-be code
echo list_all_files($the_directory);

result
myFile.php
myFile2.php
myFile3.php