エラーメッセージ
PHP Notice: fputcsv(): delimiter must be a single character in /work/app/sample.tsv on line 4
問題のコード
sample.php
<?php
$handle = fopen('sample.tsv', 'w');
fputcsv($handle, ['apple', 'banana', 'lemon'], '\t');
fclose($handle);
問題点
シングルクォーテーションで囲んでいたのが問題でした。
sample.php
fputcsv($handle, ['apple', 'banana', 'lemon'], "\t");
'\t'
を "\t"
と変更するとエラーメッセージがなくなりました。