Home / PHP / Get Root Directory Path of a PHP project

Get Root Directory Path of a PHP project

Get the document root –

$_SERVER[‘DOCUMENT_ROOT’]

Get the current file’s folder

__DIR__

Hits: 24

Leave a Reply