It can be a path like "html/website/index.html" for scripts in directories below the curent php script running this code.
<?php
// Store the file name in a string.
$filename = "dir/www/file.txt";
// Read file into array
$contents = file($filename);
?>Now if you need to get the contents of a file that is in a different directory on the same level (or higher) than the directory with the php script you would use the Unix statement "../" before your file path. Let me demonstrate. lets say the php file script is in "dir1" but we want to read a text file in "Subdirofdir2":
>website
>>dir1 <-PHP Script
>>>Subdirofdir1
>>dir2
>>>Subdirofdir2 <-Text FileWe can't use the path "dir2/subdirofdir2/text.txt" because there is no path like that in the current php script's directory. (the php script is in "dir1" remember). However if we could get to the "website" directory (which is the root) we could then use the "dir2/subdirofdir2/text.txt" path and it would work. So if we add the unix "../" before the path php will look for the path in the directory 1 above the current directory path (which is "website").
So our path from the php script to the text file should be:
<?php
// Go up one level - then look for the "dir2" directory.
$filename = "../dir2/subdirofdir2/text.txt";
// Read file into array
$contents = file($filename);
?>