Ya vi el ejemplo y lo hize y me paso lo que me ha pasado ahora:
Prueba uno con archivo no hospedado en el servidor:
<?php
$filename = 'http://www.forosdelweb.com/images/profile.gif';
if (file_exists($filename)) {
print "The file $filename exists";
} else {
print "The file $filename does not exist";
}
?>
Resultado:
The file http://www.forosdelweb.com/images/profile.gif does not exist
Prueba dos con archivo hospedado en el servidor:
<?php
$filename = 'prueba.txt';
if (file_exists($filename)) {
print "The file $filename exists";
} else {
print "The file $filename does not exist";
}
?>
Resultado:
The file prueba.txt exists