. . . "BEWARE, a couple of the examples in the comments suggest doing something like this:chmod(file_or_dir_name, intval($mode, 8));However, if $mode is an integer then intval( ) will not modify it." .