PHP supports file operations by providing users with a plethora of file-related functions.
In the case of opening a file, the fopen() function is used. This function can open a file or a URL as per requirement. It takes two arguments: $filename and $mode.
Syntax:
resource fopen ( string $filename , string $mode [, bool $use_include_path = false [, resource $context ]] )