I can give you a quick look into how arrays work.
I will take your example:
The way your array is filled when reading the domain.txt
array[0] => example.com
array[1] => example.org
array[2] => example.net
This means that for every line it reads from domains.txt it will create a new entry, arrays always start with 0 if you use numeric values. You can also use names if you like.
Example
array['name'] => john doe
array[émail'] => johndoe@example.com
You can also have multidimensional arrays (arrays in arrays).
Example
array[0] => array[0] => test, array[1] => some text, array[2] => a bit more
array[1] => just some text here
Note that this is a very straight forward answer and not going into depth with arrays. There are a lot of tuts out there that will explain arrays in much more detail.