PHP fopen() function is used to open file or URL and returns resource. It accepts two arguments: $filename and $mode.
Syntax:
resource fopen ( string $filename , string $mode [, bool $use_include_path = false [, resource $context ]] )