fopen to check if file exists

From: Date: Sat, 08 Dec 2001 11:48:18 +0000
Subject: fopen to check if file exists
Groups: php.general 
Request: Send a blank email to php-general+get-77109@lists.php.net to get a copy of this message
I am using this function: function isAfile($url){ $fp = @fopen("$url","r"); if ($fp) { //print "The file exists!"; return 1; } else { //print "The file does not exist"; return 0; } } to check if a remote file exists... now the problem is that the URL's i am trying to check are in this way: http://waptopic.supereva.it/loghiesuonerie.it/LogoGen.php?id=1100 The problem is that LogoGen.php exists but depending on the ID the image may exists or not. How can i actually check if the image exists? Thanks anyone!

« previous php.general (#77109) next »