main directory
MAIN
child directory
MAIN/сontent/
the file which contains the line:
content1.txt // file
images/images1.jpg child directory with invoked scripts
MAIN/script/
$a = '/content/content1.txt'; $a = file_get_contents($a); echo $a; Task: To make so that, php executed the following instructions.
Поиск файла => => Файла нет в текущей директории => => Перейти в родительскую папку => => Искать там => прочитать => выдать содержимое. I thought and found 3 possible answers:
1 - use chdir in scripts by condition.
2 - set the absolute path of the form ../content/content1.txt;
3 - write your function to automate the process.
Question Is the 4th option possible?
Maybe there is a ready-made function that fulfills these conditions, or another method.