today i was writing a script and i wanted to check if a file i wanted to write using php was able to write to. can you tell me how i can check to see if a file is writable or not. i mean i just want to verify that this file i can put information and has the right permissions for writing like editing and adding or removing text from it

how can i do that?