I am trying to use this :
preg_match("!^.(.*?)(/[^/]+){2}$!", $_SERVER['PHP_SELF'], $parent);
echo $parent[1];
Which in itself does work, and gives the name of the parent directory, when the {n} is changed, will give the child, and grandparent etc...
I am not trying to modify it to use realpath(getcwd()) instead of the PHP_SELF...
So
preg_match("!^.(.*?)(/[^/]+){2}$!", realpath(getcwd()), $parent);
echo $parent[1];
Now gives me nothing - due to the / slashes now being \ (on a windows box) - changing both / to \ doesn't work either.
But changing the {2} to {0} does give me everything - so I know I am on the right track. But my use of regexps is limited....
Any help - pointing in the right direction ?
Cheers,