Skip to content

Kirby 4.7.0

F::write()

Creates a new file

F::write(string $file, mixed $content, bool $append = false): bool

Parameters

NameTypeDefaultDescription
$file *stringThe path for the new file
$content *mixedEither a string, an object or an array. Arrays and objects will be serialized.
$appendboolfalsetrue: append the content to an existing file if available. false: overwrite.

Return type

bool

Parent class

Kirby\Filesystem\F