I wrote it in a bit different way. Now the problem is with how I add stuff into the arrays apparently.
Here's the code:
$lines = file("text2.txt");
$array = array();
foreach($lines as $line)
{
if(preg_match_all('/([\d]+)/',$line,$match))
{
foreach($match as $number)
$array[] = $number;
}
}
echo '<pre>'; print_r($array);echo "</pre>";
Here's the result:
Array
(
[0] => Array
(
[0] => 100
)
[1] => Array
(
[0] => 100
)
[2] => Array
(
[0] => 35
)
[3] => Array
(
[0] => 35
)
[4] => Array
(
[0] => 234
)
[5] => Array
(
[0] => 234
)
[6] => Array
(
[0] => 73
)
[7] => Array
(
[0] => 73
)
[8] => Array
(
[0] => 12
)
[9] => Array
(
[0] => 12
)
[10] => Array
(
[0] => 37
)
[11] => Array
(
[0] => 37
)
)
It repeats twice and is inside another array!