← All docs

file_put_contents()

Writes data to a file.

file_put_contents()

function file_put_contents(string $filename, string $data): int

Writes data to a file.

Parameters:

  • $filename (string)
  • $data (string)

Returns: int

Availability

No examples yet — check examples/ and showcases/ for usage patterns.

Internals

For how file_put_contents is implemented in the compiler, see the internals page.