I was trying to create a directory with chmod set to 757. I used mkdir() and was able to create a new directory but it set the chmod to 755. I finally got it working using this:
mkdir($dir_name,0757);
chmod($dir_name,0757);
I have been able to create directories and change their chmod value just by using mkdir(). Does anyone know why I need chmod() this time? Could it be the server?