Hi there!
I have a file like that:
Code: Select all
1 2
1 3
1 4
2 5
7 5
3 4
8 6
9 22
....
There're two columns records - connection points of the graphs per line. Point 1 connected with point 2, 3 and 4. And point 2 connected to point 5 and so on...
Every point can exists in any column. So what I need in output is an array like this:
Code: Select all
0 => '1,2,3,4,5,7',
1 => '8,6',
2 => '9,22',
...
Cause there're can be many graphs described in the file. For such a task I need to use recursive function call to array walk, but my mind goes crazy how this can be done.
Can you help, pls. Thanks beforehand.