点在相对文件路径中是什么意思? [英] What do the dots mean in relative file path?

查看:144
本文介绍了点在相对文件路径中是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是我自己编程和学习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. 据我了解,$_SERVER[DOCUMENT_ROOT]指向文件结构的根目录,例如htdocs,www或public_html在不同服务器上.请指导我是否正确理解?
  2. 上面的路径中的两个点是什么意思?
  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?

谢谢

推荐答案

..表示父目录,因此它向上一级进入文档根目录的同级目录orders.

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

这篇关于点在相对文件路径中是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆