Include files from parent directory, subdirectory – WortGepresst



STARTSEITE MULTIMEDIA WORTGEPRESST FAMILIENBANDE BOOKMARK PRIVACY


Include files from parent directory, subdirectory

Get parent directory from within sub-directory

For WordPress plugins, here is how to get and/or include a file that is located in the parent directory:

PHP

 
Note that you can customize this code snippet by editingexample.phpwith the file that you would like to get or include.

Get subdirectory from within parent directory

For WordPress plugins, here is how to get and/or include a file that is located in a subdirectory:

PHP

 
Note that you can customize this code snippet by editinginc/example.phpwith the path and file that you would like to get or include.

Get subdirectory from within same subdirectory

For WordPress plugins, here is how to get and/or include a file that is in the same subdirectory:

PHP

 
And here is how to do it without using WordPress:

PHP

 
Note that you can customize this code snippet by editing/inc/example.phpwith the path and file that you would like to get or include.

Get any same-level directory

For WordPress plugins, here is how to get and/or include a file that is located in any same-level subdirectory:

PHP

 
To get a different-level directory, check out thelevelsparameter of thePHP’s dirname function. Note that you can customize this code snippet by editing/inc/example.phpwith the path and file that you would like to get or include.

Get file from same directory

With or without WordPress, we can get and/or include a file that is located in the same directory:

PHP

 
Note that you can customize this code snippet by changingexample.phpto the name of the file that you would like to get or include.

 

Font Resize
Contrast
Zur Werkzeugleiste springen