note 15518 deleted from function.is-file by vincent
| From: | vincent@php.net | Date: | Sat, 16 Aug 2003 14:33:09 +0000 |
| Subject: | note 15518 deleted from function.is-file by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-54367@lists.php.net to get a copy of this message | ||
Note Submitter: wildpeaks@warpdawg.com
----
Pour tester l'existence d'un fichier (distant ou pas)(non testé sur serveur même mais au
moins pour distant oui) sans avoir de message d'erreur quand le fichier n'existe pas:
$temp = error_reporting(E_ALL & ~(E_ERROR | E_WARNING | E_PARSE | E_NOTICE | E_CORE_ERROR |
E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_USER_ERROR | E_USER_WARNING |
E_USER_NOTICE));
$file = fopen ("$homepage", "r");
if (!$file) {
echo "Cette url est cassée, verifiez-en l'orthographe je vous prie";
}
error_reporting($temp);