note 93710 added to function.fopen

From: Date: Wed, 23 Sep 2009 21:08:39 +0000
Subject: note 93710 added to function.fopen
Groups: php.notes 
Request: Send a blank email to php-notes+get-160998@lists.php.net to get a copy of this message
A note to ken dot gregg at rwre dot com: > $write_handle = fopen($write_file, "w") || die("Couln't open file"); > fclose($write_handle); > > Returns a "supplied argument is not a valid stream resource" error in the fclose() > and file handle is 1. > The returned file handle should be something like "Resource id #x". The code executes properly. The code to the right of the = evaluates to a Boolean value, which is not a valid file handle. Replace '||' with 'or'. ---- Server IP: 209.41.74.194 Probable Submitter: 209.233.23.4 ---- Manual Page -- http://www.php.net/manual/en/function.fopen.php Edit -- https://master.php.net/note/edit/93710 Del: integrated -- https://master.php.net/note/delete/93710/integrated Del: useless -- https://master.php.net/note/delete/93710/useless Del: bad code -- https://master.php.net/note/delete/93710/bad+code Del: spam -- https://master.php.net/note/delete/93710/spam Del: non-english -- https://master.php.net/note/delete/93710/non-english Del: in docs -- https://master.php.net/note/delete/93710/in+docs Del: other reasons-- https://master.php.net/note/delete/93710 Reject -- https://master.php.net/note/reject/93710 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#160998) next »