note 21013 deleted from function.fopen by hholzgra
| From: | hholzgra@php.net | Date: | Fri, 12 Jul 2002 15:05:35 +0000 |
| Subject: | note 21013 deleted from function.fopen by hholzgra | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-32989@lists.php.net to get a copy of this message | ||
this example:
$out=fopen("file","w") || die ("file won't
open");
is _not_ true on my server (linux redhat) and windows98se - it's creating an empty file, but
fwrite shows only error like that: $out is not right file handle.
when i remove die clausule, it works fine!
instead above example, use this:
$out=fopen ("file.txt", "w");
if ($out) {
fwrite ($out, "some text");
fclose ($out);
} else {
echo "error";
}
btw: don't use 'die' within functions in ur classes - it kills php!
greetz:)
Sir_Fred