Assuming you are referencing a local file, you can use:
<?php
if (file_exists("/path/to/folder") {
func1();
} else {
func2();
}
?>
or,
<?php
if (file_exists("/path/to/file.html") {
func1();
} else {
func2();
}
?>
If however you are referencing a remote file you can (I think) use
url_exists("www.somedomain.com/folderorfile")
in the same way.
Hope this helps