File
in package
Table of Contents
Methods
- create() : int|false
- Creates a file with the given content. This method validates if the file exists, otherwise it's created. When it exists, the content is appended.
- createFromTemplate() : int|false
- Creates a new file from a template with the given tokens.
- getContent() : string|false
- Gets the content of the file or a URL.
Methods
create()
Creates a file with the given content. This method validates if the file exists, otherwise it's created. When it exists, the content is appended.
public
static create(string $filename[, mixed $content = '' ][, int $append = FILE_APPEND ]) : int|false
Parameters
- $filename : string
- $content : mixed = ''
- $append : int = FILE_APPEND
Return values
int|falsecreateFromTemplate()
Creates a new file from a template with the given tokens.
public
static createFromTemplate(string $filename, string $template, array<string|int, mixed> $tokens) : int|false
Parameters
- $filename : string
- $template : string
- $tokens : array<string|int, mixed>
Return values
int|falsegetContent()
Gets the content of the file or a URL.
public
static getContent(string $filename) : string|false
Parameters
- $filename : string