Hello just looking for some help as I've gotten stuck
I have two Strings:
C:\Users\Bob\My Documents
/Users/Bob/Documents
That gets put through
preg_split('/(?<=[\/\\\])(?![\/\\\])/', $string)
that returns
Array
(
[0] => C:\
[1] => Users\
[2] => Bob\
[3] => My Documents
)
Array
(
[0] => /
[1] => Users/
[2] => Bob/
[3] => Documents
)
I need
Array
(
[C:\] => Array
(
[Users] => Array
(
[Bob] => Array
(
[My Documents] => array()
)
)
)
)
Array
(
[/] => Array
(
[Users] => Array
(
[Bob] => Array
(
[Documents] => array()
)
)
)
)
And ultimately merged to
Array
(
[C:\] => Array
(
[Users] => Array
(
[Bob] => Array
(
[My Documents] => array()
)
)
)
[/] => Array
(
[Users] => Array
(
[Bob] => Array
(
[Documents] => array()
)
)
)
)
(properly merged, not just appended, so if another string started with C:\Users\Dan
Then dan would appear on the ?3rd? Dimension. array_merge_recursive()
? )