I was wondering if there was a shorter version of $_SERVER['DOCUMNET_ROOT'] defined somewhere globally by php? It's kinda a hassle typing all those bracket characters, single-quotes, underscores, and stuff. So I was wondering if there was some kind of global variable for this something shorter, like DOCUMENT_ROOT or $DOCUMENT_ROOT or something. I try googling it but all I get is $_SERVER['DOCUMENT_ROOT'], so I'm assuming there isn't such a thing as what I'm asking for.
But I thought I'd throw this out to DevNetwork (seeing as how you guys are so smart o_-). If not I'll just keep using $_SERVER['DOCUMNET_ROOT'], it's better then having to type /home/b/l/a/blablabla/html for every include statement.
Thanks.
DOCUMENT_ROOT
Moderator: General Moderators
Re: DOCUMENT_ROOT
Code: Select all
define('DROOT', $_SERVER['DOCUMENT_ROOT']);
echo DROOT;