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']) 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; } Link to comment https://forums.phpfreaks.com/topic/248310-function-giving-me-trouble/#findComment-1275094 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.