Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ファイルへの書き込みを使用file_put_contentsしていますが、コンテンツが重複しています... 2x と 1x lituraを書きました
file_put_contents
file_put_contents($_SERVER['DOCUMENT_ROOT'].'/test/test.tmp', '1 ', FILE_APPEND);
test.tmp の内容
11
すでにApacheを再起動しており、htaccessなしで直接アクセスしています。
追加モードで使用file_put_contentsしているため、スクリプトを実行するたびに 1 が追加されます。第 3 パラメーターなしのコードを使用します。
file_put_contents($_SERVER['DOCUMENT_ROOT'].'/test/test.tmp', '1 ');
これで、ファイルの出力はtest.tmp常に 1 になります。
test.tmp