I’m trying to read data from a text file and assign it to arrays. How could I read exactly 3 lines at a time, and then assign the first line to array $a, second line to array $b, third line to array $c? and then read exactly 3 more lines, etc.
Share
Note that you’ll want to do some out-of-bounds index error checking, as well. I leave that as an exercise for the OP.