I know, I know, this sounds soo easy. But I can\'t seem to find the correct answer on the Internet.
One of the solution I found was to use i
i
bool file_exists ( string $filename )
Checks whether a file or directory exists.
http://php.net/manual/en/function.file-exists.php