A
A
Alexander Interesting2021-07-22 11:44:42
PHP
Alexander Interesting, 2021-07-22 11:44:42

How to get root path using "." and ".."?

How to get path back to root? For example
https://example.com/test/another_test/index.php
, you need to get the path to
https://example.com/
. In this case, the path should look like:
/../../

How to do this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
aagzip, 2021-07-22
@Swimergg

Why not just use /?
../is a relative path.
/- absolute

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question