After converting the file
$rows = array_map('trim', file($lines1));
foreach ($rows as $key => $value) {
$params = array_map('trim', explode(';', $value));
}
an array of the following type is obtained, which is contained in a variable:
Array ( [0] => 0 [1] => 1 [2] => 2 [3] => i need this [4] => 4 [5] => 5 [6] => 6 [7] => 7 [8] => 8 [9] => 9 [10] => 10 [11] => 11 [12] => 12 [13] => 13 [14] => 14 )
Array ( [0] => 0 [1] => 1 [2] => 2 [3] => i need this [4] => 4 [5] => 5 [6] => 6 [7] => 7 [8] => 8 [9] => 9 [10] => 10 [11] => 11 [12] => 12 [13] => 13 [14] => 14 )
etc...
how can you combine these arrays and put the values with the key = 3 into separate variables. View:
Array ( [0] => i need this [1] => i need this and etc...
CodePudding user response:
$range = range(1, 100);
$result = array_combine($range, $range);
check array_combine