Environment variables are normal global variables, so you must either declare them as global variables in your function (by using "global $DOCUMENT_ROOT;", for example) or by using the global variable array (ie, "$GLOBALS["DOCUMENT_ROOT"]").
Environment variables are normal global variables, so you must either declare them as global variables in your function (by using "global $DOCUMENT_ROOT; ", for example) or by using the global variable array (ie," $GLOBALS["DOCUMENT_ROOT"] ").