What is the difference between fopen() and fclose()?



What is the difference between fopen() and fclose()?..

Answer / Ishant Tyagi

fopen() is a PHP function that opens a file, while fclose() is used to close the opened file. When you open a file with fopen(), you can read from or write to it using other functions like fread() or fwrite(). Once you are done working with the file, you should call fclose() to free up system resources.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More PHP Interview Questions

With a heredoc syntax, do I get variable substitution inside the heredoc contents?

1 Answers  


How to read the entire file into a single string?

1 Answers  


Where can I learn php?

1 Answers  


Is php easy language to learn?

1 Answers  


What is the use of curl()?

1 Answers  


Should I learn php before wordpress?

1 Answers  


Which function is used to read a single character from a file in PHP.

1 Answers  


How to store the uploaded file to the final location?

1 Answers  


Suppose we receive a form submitted by a post to subscribe to a newsletter. This form has only one field, an input text field named email. How would we validate whether the field is empty? Print a message "the email cannot be empty" in this case?

1 Answers  


how many type of url?

1 Answers  


Does apache use php?

1 Answers  


What the use of var_dump()?

1 Answers  


Categories