I have a path like this:
parent/child/reply
How do I use PHP to remove the last part of the path, so that it looks like this:
pare
preg_replace("/\/\w+$/i","",__DIR__); # Note you may also need to add .DIRECTORY_SEPARATOR at the end.