I got a string, which gives me the location of something:
/var/www/web1/htdocs
The problem is: The last part could possibly change: It could also be /var/www/web1/public_html
or /var/www/web1/httpdocs
.
Now I would like to get the path without the last part of the path:
/var/www/web1
How can I do that?
As far as i understand your question, you need something like this