D
D
DEnisLEB2018-04-15 09:21:33
PHP
DEnisLEB, 2018-04-15 09:21:33

How can I specify an incomplete path in php?

Let's say I'm making a block site, the php language templates are buried in the depths of the site, you need to specify an incomplete path through the include
file of a single entry point has a load of all scripts, but there is a problem, the scripts need a full path, and I need to specify without taking into account the domain / root folder, let's say not so D:/domen.ru/full_version/js/nprogress.js , and like this /full_version/js/nprogress.js

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Sklyarov, 2018-04-15
@DEnisLEB

$_SERVER["DOCUMENT_ROOT"]

B
Boris Syomov, 2018-04-15
@kotomyava

php.net/manual/ru/language.constants.predefined.php
You need __FILE__ and __DIR__ there

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question