Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What do the dots mean in relative file path?

Tags:

php

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

like image 691
daNullSet Avatar asked Aug 22 '12 04:08

daNullSet


1 Answers

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

like image 74
Joey Avatar answered Nov 15 '22 23:11

Joey