PHPの教科書21 ファイルを生成して書き込み

ファイルをスクリプトで保存する方法です。
これ、どういう場面で使うんだろう・・・
http://felica.boy.jp/textbook/lecture1-4-2.php

<?php
//file_put_contents('ファイルパス名, '書き込む内容')
$success = file_put_contents('./news_data/news.txt', '2010-06-01 ホームページをリニューアルしました');
?>

<?php
if ($success) {
	print('<p>ファイルへの書き込みが完了しました。</p>');
} else {
	print('<p>書き込みに失敗しました。ディレクトリの権限などを確認してください。</p>');
}
?>