OK I have a text file that looks like this
....................
....................
19511425 ./public_html/download
....................
....................
12665106 ./public_html/scripts
....................
Right now I have a regex that returns an array of the directory sizes but not in the format that I wanted.
Here is the REGEX:
preg_match_all('/(\d+)\s+(.\/public_html\/(download|scripts))\n/si',$ducache, $matches);
print_r($matches);
It returns:
Array
(
[0] => Array
(
[0] => 5694979 ./public_html/download
[1] => 19511425 ./public_html/scripts
)
[1] => Array
(
[0] => 5694979
[1] => 19511425
)
[2] => Array
(
[0] => ./public_html/download
[1] => ./public_html/scripts
)
[3] => Array
(
[0] => download
[1] => scripts
)
)
I am trying to group the size and directories in one array, something like this:
Array
(
[0] => Array
(
[0] => 5694979
[1] => ./public_html/download
)
[1] => Array
(
[0] => 19511425
[1] => ./public_html/scripts
)
)
Can anybody tell me how to do it?
Thanks in advance!