Currently I have an array that lists email addresses as the key and urls as the values, I want to use parse_url (unless something better is suggested) and create another dimension to the array with the base url. This is what I currently have:
array (
'[email protected]' =>
array (
0 => 'http://www.google.co.uk/foo/bar',
1 => 'http://www.reddit.com/r/programming/',
),
'[email protected]' =>
array (
0 => 'http://stackoverflow.com/faq',
1 => 'http://de.php.net/parse_url',
),
'[email protected]' =>
array (
0 => 'http://www.bleepingcomputer.com/forums/',
),
)
And this is what I want the output to be:
array (
'[email protected]' =>
array (
0 => 'http://www.google.co.uk/foo/bar',
array (
0=> 'www.google.co.uk'
)
1 => 'http://www.reddit.com/r/programming/',
array (
0=> 'www.reddit.com'
),
),
'[email protected]' =>
array (
0 => 'http://stackoverflow.com/faq',
array (
0=> 'http://stackoverflow.com'
)
1 => 'http://de.php.net/parse_url',
array (
0=> 'de.php.net'
),
),
'[email protected]' =>
array (
0 => 'http://www.bleepingcomputer.com/forums/',
array (
0=> 'http://www.bleepingcomputer.com'
),
),
)
Any help is very much appreciated!