What is umask in PHP
In this article I am going to explain about umask function in PHP.
PHP umask() Function
The filesystem umask function changes the file permission for files. The umask function without arguments simply returns the current umask otherwise the old umask is returned.
Syntax of umask function
Parameters in umask function
It has only one parameter:
Parameter |
Description |
mask |
It specifies the new permission. |
Example of filesystem umask function
<html>
<body>
<?php
$old = umask(0);
chmod("dir.php", 0777);
$result=umask($old);
echo "The result is:" .$result;
if ($old != umask())
{
die('An error occured !');
}
?>
</body>
</html>
|
Output:
You may also want to read these related articles :here
Ask Your Question
Got a programming related question? You may want to post your question here
Programming Answers here