Mine
public text v1 · immutable while ($i<5) {
$fp = fopen ("$this->cachedir/$this->imdbID.$wt", "w");
if ($fp) {
$fw = fputs ($fp, $this->page[$wt]);
if ($fw >= 20480) {
$i =5;
}
elseif ($fw == 215) {
die('ERROR: This IMDB number is no longer valid, please update.');
}
elseif ($i=4) {
die('ERROR: The number of attempts to write cache properly has been exhausted.');
}
else {
unlink($fp);
$i++;
}
}
}