Запись в файл с помощью fwrite()
<?php
$content = "Hello, world!";
$f = fopen('/path/to/file', 'wb');
fwrite($f, $content, strlen($content));
fclose($f);
<?php
$content = "Hello, world!";
$f = fopen('/path/to/file', 'wb');
fwrite($f, $content, strlen($content));
fclose($f);