Просмотр поста #63812: >>>ВОПРОСЫ НОВИЧКОВ<<<

.
Z3RO

Провел отладку и обнаружил, что проблема в цыкле.

Вот этот код:

$countFormats = count($possibleImgFormats);
    for($i = 0; $i < $countFormats; ++$i)
    {
        echo $possibleImgFormats[$i] . ' ';
        if(file_exists($home . '/files/avatars/' . $this->id . '/' . $this->size . '.' . $possibleImgFormats[$i]))
        {
            $format = $possibleImgFormats[$i];
        }
        else
        echo 'error!<br/>';
    }


...выведет

png error!
jpg error!
gif error!

Хотя файл существует. В чем может быть проблема? Пробывал напрямуй через if{...} else if{...} else{...}--та же проблема.
Тому, кто поможет +5