note 42625 deleted from function.chmod by googleguy
| From: | googleguy@php.net | Date: | Tue, 22 Oct 2013 06:51:53 +0000 |
| Subject: | note 42625 deleted from function.chmod by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-196682@lists.php.net to get a copy of this message | ||
Note Submitter: raven_25041980 at yahoo dot com
----
If you have a mode as a string, chmod will insanely mess up your permissions. Instead of using
<?php
@chmod($file_or_dir_name, $mode);
?>
use
<?php
@chmod(file_or_dir_name, intval($mode, 8));
?>
where 8 -> the base to convert into. You need octals, baby, for chmod...
More on intval here: http://www.php.net/manual/en/function.intval.php