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
- Compiled (AOT): supported by the Elephc code generator.
eval()(magician interpreter): supported — declarative interpreter builtin (crates/elephc-magician/src/interpreter/builtins/filesystem/file_put_contents.rs).
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.