These both are PHP inbuilt function which is used to open & close a file which is pointed file pointer.

S.no fopen() fclose()
1. This method is used to open a file in PHP. This method is used to close a file in PHP. It returns true or false on success or failure.
2. $myfile = fopen("index.php", "r") or die("Unable to open file!"); $myfile = fopen("index.php", "r");
BY Best Interview Question ON 26 Jan 2019