Create a spiral output from a .txt file

Hi free code camp please help solving this problem

I have a sample text file name spiral.txt and the sample contents is
3
124
567
098
4
1234
5678
9012
2
12
4


Thats is the sample input on the text file and when i open it the sample output will be
Output 1: 124789056
Output 2: 123482109567
Output 3: 124

Thats the output spiral order on the input provided in the text file
Please help with this thanks a lot i hope i can i have a positive feed back.

The 3 4 and 2 i gues its indicate as the number of rows per line the 2 represent two lines …
For example i want to run it in php code the output would be spiral order like spiral matrix but the inputs are coming from the spiral.txt

Like for example i open the i dont realy sure if its the right syntax

$filecontents = fopen(“spiral.txt”,“r”);
And then when the file contents got extracted i will createva function that would output in spiral order
Example:

sample output will be
Output 1: 124789056
Output 2: 123482109567
Output 3: 124

Oh im sory it should 4 any just put down any number that 4 digits on to make it 4 lines

I am trying to figure out this one on how to make a program the run that output from a spirtal.txt

I hope can help me with this thanks alot man