I am trying to grab only the folder structure from path of URL's, and I can't quite work it out.
I have tried using parse_url, but that get's me the whole path, and from there I tried using explode and regex methods, but non of the one's I have tried give me what I'm after.
An example list of URL's would be:
/example.html
/folder/example.html
/example/folder/example.html
/example/folder/two/
and the results I need are:
/
/folder/
/example/folder/
/example/folder/two/
I'm probably just being blind, or having a coders block, so any help would be appreciated.