php - include file(s) from another directory -
Currently I'm trying to include one PHP file from another file.
public_html / a / class / test.php & lt; - From this file I can see public_html / b / common.php & lt; I want to include a file from - I want to include this file Make sure what I should do because I
dirname (__ FILE__) and it is but it does not help me in getting my file. You can proceed to the directory tree until you have an ordinary ancestor: / P> The magic was introduced in continuous BTW, Emptors, such as PHPStorm also understand this use of relative path. public_html /
dirname (__ file __). '/ .. / b / common.php' / code>
is required dirname (dirname (__DIR__)). '/b/common.php'; __dir __ equal to dirname (__file __) , and 5.3. Each use of dirname () goes back to a directory, i.e.:
dirname ('public_html / a / class'); // public_html / one dime ('public_html / a'); // public_html
Comments
Post a Comment