How do i simply write out a file including real tabs inside? tab
means real tab
which is not the spaces. How to write the tab
or what is the character for real tab
?
For example here:
$chunk = "a,b,c";
file_put_contents("chunk.csv",$chunk);
What character should i use to get tabs
instead of Commas (,)
there?
In the output file, there should be real tabs
between the seperated words.
<tab>
key in a text-editor.Use \t
and enclose the string with double-quotes:
$chunk = "abc\tdef\tghi";
This should do:
$chunk = "abc\tdef\tghi";
Here is a link to an article with more extensive examples.
Source: Stackoverflow.com