mykg4orce wrote:fopen is meant to open a file which implies that you will at some point fclose($handle) that file.
You don't have to, though - PHP's garbage collection process will close the open handle (which doesn't necessarily point to a file, by the way :p) after the script has finished executiong.
mykg4orce wrote:fopen will lock that file, any script that tries to open it will fail.
No, it won't; that's the job of [man]flock/man. EDIT: Also note that just because you open a file for reading or writing doesn't mean that you must lock it (meaning multiple programs can be accessing the file at once if you don't lock it).
anoopmail wrote:i'm still not clear that the resource handle would create in the local server in which the script runs or in the remote server. which memory will be utilized?
I'm not sure I understand your question... Are you asking if fopen() will open a file resource handle on a remote server? If so, you might want to stop and think about that - why would you be able to manipulate resource handles on a remote server?