If the file is local on the machine or available via a network path you can just use the bool file_exists ( string $filename ) function:
If (file_exists("\\server\pat
But if you want to check the existance of a file on the internet at some URL then file_exists won't work, but you could use fopen instead. If fopen fails then the file is not accessible, otherwise it will open the file successfully. Eg.
if (fopen("www.myurl/file.mp3
// File exists.
}
else {
// File is not accessible.
}
regards,
Psyberion.
Main Topics
Browse All Topics





by: fsouzabrasilPosted on 2009-11-03 at 08:54:06ID: 25730942
use curl for this purpose.
ook.curl.p hp
http://php.net/manual/en/b