chmod() function changes the mode of filename to permissions.
Its syntax is: int chmod (string filename, int permissions)
The permissions must be specified in octal mode.
<?
chmod ("data.txt", 0766); // This will work
?>
Related examples in the same category