in reply to RE: Re: Inputing info into Nested Arrays
in thread Inputing info into Nested Arrays
split with no arguments takes a line from $_ and splits it on whitespace (e.g, /\s+/) after disregarding leading spaces. So, that creates the 'inner' array from each line (each word in the line is 1 element), and then the 'outer' array is created with each line as an element. So,
would be read in like this:This is a test. This is line #2
$array[0][0] = "This"; $array[0][1] = "is"; $array[0][2] = "a"; $array[0][3] = "test"; $array[1][0] = "This"; $array[1][1] = "is"; $array[1][2] = "line"; $array[1][3] = "#2";
And of course, you are going to have to change this based on your data file's structure.
|
|---|