GrayHat
16.01.2004, 16:36:24
siema. napisalem taki kodzik i mam pyt czy macie lepszy pomysl na rozwiazanie tego problemu. problem jest taki, ze chce sprawdzic czy plik istnieje ale na innym servie... moj kod:
[php:1:1d41da408e]<?php
if (@fopen($vars->file_url),"r")){
//plik istnieje
} else {
//plik nie istnieje
}
?>[/php:1:1d41da408e]
FiDO
16.01.2004, 18:59:10
Cytat
If you are trying to check whether a remote file (or url) exists, you can open it and close it in the same statement.
[php:1:d84fd24dbe]<?php
if (@fclose(@fopen("http://www.example.com", "r"))) {
print("File exists.");
} else {
print("File does not exist.");
}
?>[/php:1:d84fd24dbe]