mkdir with relative url

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
neridaj
Forum Commoner
Posts: 40
Joined: Fri Jan 05, 2007 9:55 pm

mkdir with relative url

Post by neridaj »

Hello,

Is it possible to pass mkdir() a relative url instead of an absolute url? My hosting company decided to change the directory name for the root of a client's usr directory and I've had to update the functions accordingly. If possible I would rather not have functions hardwired to the usr root.

Code: Select all

 
function create_folder($username)
{
    mkdir("/home/.this has been changed/username/domain.com/subdir/$username", 0755);
}
 
 
Thanks,

Jason
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: mkdir with relative url

Post by VladSun »

You may always use getcwd() or realpath().
There are 10 types of people in this world, those who understand binary and those who don't
Post Reply