Get Root Directory Path of a PHP project

Root Directory Path of a PHP

#Get the document root –

$_SERVER[‘DOCUMENT_ROOT’]

#Get the current file’s folder

__DIR__

Leave a Reply