I have a php script that saves 3 words to a text file every time it is run, how do I align those words to always be at a certain point in the line in different rows to be like a table so for example the first word should always be at the beginning of the line, the second word should be 15 columns into the line, the third word should be 30 columns into the line.

I have researched for a long time how to do this and I couldn't find an answer that works for me.

Here is my code to save 3 variables and one word to a file

```
$example1 = "example1"
$example2 = "example2"
$example3 = "example3"

$myfile = fopen("example.txt", "a");
$txt =  "\n$example1 $example2 word $example3";
fwrite($myfile, $txt);
fclose($myfile);

```

each time I run this php my variables wont necessarily be the same length (they will never be longer than 15 characters, so I think that is a good distance between each column), so they could look like this...

```
$example1 = "example123"
$example2 = "example34"
$example3 = "exam"

```

Currently my results in the text file look like this after I run it twice with those two examples

```
example1 example2 word example3
example123 example34 word exam

```

but I want it to look like this

```
example1       example2       word example3
example123     example34      word exam

```