I have an array of paths that I would like to sort ...
Array
(
/something/foo1
/something/special/foo2
/something/foo3
/something/special/foo4
/something/foo5
/something/special/foo6
)
... so that all paths that contain /special/
end up at the end of the array like this:
Array
(
/something/foo1
/something/foo3
/something/foo5
/something/special/foo2
/something/special/foo4
/something/special/foo6
)
The original sort order of paths must remain the same (so 1,2,3,4,5,6
=> 1,3,5,2,4,6
). Is there an elegant way to do this? Can this be implemented by using the usort function?