Use function fopen to open a file. fclose will close the file

Code:
<?php

$fp = fopen("filename.txt", "r");
fclose($fp);
$fp here is file pointer.

fopen have two parameters. First parameter is file name, that points to file to be opened.

"r" means file is opened for reading. You can only read file the file. You can open file for writing with "w".