Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am new to programming and learning php on my own. I have two question about the following relative path of a file

$fp = fopen ("$_SERVER[DOCUMENT_ROOT]/../orders/orders.txt", 'w');

My questions about the relative path in the code above are that:

  1. What I understand, $_SERVER[DOCUMENT_ROOT] points to the very root directory of the file structure like htdocs, www or public_html on different servers. Please guide if I am understanding it correctly?
  2. What do the two dots mean in the path above?

Thank You

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
356 views
Welcome To Ask or Share your Answers For Others

1 Answer

.. means the parent directory, so it goes one level up there and into a sibling directory of your document root called orders.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...