I have code, where I create file and write string in that file
PHP:

$string = "Some text \t any text";
$handle = fopen($filename, 'w');
fwrite($handle, $string);
fclose($handle);

Output as same as I try to create

Some text \t any text