HCProfessionals Posted October 3, 2011 Share Posted October 3, 2011 What I can Do: function createDir($path = '/path/to/root/') What I Need To Do: Something like this $server_root = $_SERVER['DOCUMENT_ROOT']; function createDir($path = $server_root) Or This function createDir($path = $_SERVER['DOCUMENT_ROOT']) Quote Link to comment https://forums.phpfreaks.com/topic/248310-function-giving-me-trouble/ Share on other sites More sharing options...
Buddski Posted October 3, 2011 Share Posted October 3, 2011 Have you tried something like this? function createDir($path = false) { $path = ($path === false ? $_SERVER['DOCUMENT_ROOT'] : $path); // rest of your code // echo $path; } Quote Link to comment https://forums.phpfreaks.com/topic/248310-function-giving-me-trouble/#findComment-1275094 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.