Answers for "dirname(__file__) parent directory php"

PHP
2

php include file in parent directory

//If your server is not resolving the file from the parent directory using
include '../somefilein_parent.php'

//try this (using the parent directory relative to the script):
include __DIR__ . "/../somefilein_parent.php";
Posted by: Guest on June-14-2021
0

parent directory in php

I Hope this will help you.

echo getcwd().'<br>'; // getcwd() will return current working directory
echo dirname(getcwd(),1).'<br>';
echo dirname(getcwd(),2).'<br>';
echo dirname(getcwd(),3).'<br>';
Output :

C:\wamp64\www\public_html\step
C:\wamp64\www\public_html
C:\wamp64\www
C:\wamp64
Posted by: Guest on January-28-2022

Browse Popular Code Answers by Language